From 818609c2161ed82334c4dd8143a1d3fc4b34075e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 18 Sep 2026 08:58:21 +0000 Subject: [PATCH] Sync Python SDK models from atlanhq/models Source commit: a64399568ef25eaca57656599d68482993bb6011 Source ref: refs/heads/master Co-Authored-By: github-actions[bot] --- pyatlan/__init__.py | 4 +- pyatlan/client/aio/app.py | 7 +- pyatlan/client/aio/approval_workflow.py | 2 +- pyatlan/client/aio/client.py | 6 +- pyatlan/client/app.py | 9 +- pyatlan/client/approval_workflow.py | 2 +- pyatlan/client/atlan.py | 4 +- pyatlan/client/common/__init__.py | 12 +- pyatlan/client/common/app.py | 5 +- pyatlan/model/assets/bigquery_tag.py | 8 +- .../core/cosmos_mongo_d_b_collection.py | 8 +- .../assets/core/cosmos_mongo_d_b_database.py | 8 +- .../core/databricks_a_i_model_context.py | 8 +- .../core/databricks_a_i_model_version.py | 8 +- .../assets/core/databricks_genie_agent.py | 8 +- .../core/databricks_unity_catalog_tag.py | 8 +- .../assets/core/document_d_b_database.py | 8 +- pyatlan/model/assets/core/fabric_dataflow.py | 4 +- .../core/fabric_semantic_model_table.py | 4 +- .../model/assets/core/power_b_i_dataflow.py | 4 +- pyatlan/model/assets/core/s_q_l.py | 8 +- pyatlan/model/assets/core/schema.py | 4 +- .../core/snowflake_a_i_model_context.py | 8 +- .../core/snowflake_a_i_model_version.py | 8 +- .../core/snowflake_semantic_dimension.py | 8 +- .../assets/core/snowflake_semantic_fact.py | 4 +- .../core/snowflake_semantic_logical_table.py | 4 +- .../assets/core/snowflake_semantic_metric.py | 4 +- pyatlan/model/assets/core/snowflake_tag.py | 8 +- pyatlan/model/assets/databricks_dashboard.py | 8 +- .../assets/databricks_external_location.py | 4 +- pyatlan/model/assets/databricks_notebook.py | 8 +- pyatlan/model/assets/dynamo_dbtable.py | 8 +- pyatlan/model/assets/iceberg_namespace.py | 12 +- .../assets/s_a_p_b_w_composite_provider.py | 4 +- pyatlan/model/assets/s_a_p_b_w_info_object.py | 4 +- .../assets/sage_maker_unified_studio_asset.py | 4 +- .../sage_maker_unified_studio_asset_schema.py | 4 +- ...ge_maker_unified_studio_published_asset.py | 4 +- ...e_maker_unified_studio_subscribed_asset.py | 4 +- pyatlan/model/assets/sap_erp_column.py | 8 +- pyatlan/model/structs.py | 11 +- pyatlan/version.txt | 2 +- pyatlan_v9/model/assets/__init__.py | 1229 ++--------------- .../model/assets/_init_access_control.py | 2 +- pyatlan_v9/model/assets/_init_adf.py | 12 +- pyatlan_v9/model/assets/_init_adls.py | 8 +- pyatlan_v9/model/assets/_init_agent.py | 2 +- pyatlan_v9/model/assets/_init_agentic.py | 2 +- pyatlan_v9/model/assets/_init_ai.py | 8 +- pyatlan_v9/model/assets/_init_airflow.py | 6 +- pyatlan_v9/model/assets/_init_anaplan.py | 16 +- pyatlan_v9/model/assets/_init_anomalo.py | 5 +- pyatlan_v9/model/assets/_init_api.py | 10 +- pyatlan_v9/model/assets/_init_app.py | 6 +- .../model/assets/_init_app_workflow_run.py | 2 +- pyatlan_v9/model/assets/_init_artifact.py | 2 +- pyatlan_v9/model/assets/_init_asset.py | 2 +- .../model/assets/_init_asset_grouping.py | 4 +- pyatlan_v9/model/assets/_init_atlan_app.py | 6 +- .../model/assets/_init_azure_service_bus.py | 4 +- pyatlan_v9/model/assets/_init_bigquery.py | 5 +- .../model/assets/_init_business_policy.py | 2 +- pyatlan_v9/model/assets/_init_cassandra.py | 8 +- pyatlan_v9/model/assets/_init_catalog.py | 4 +- pyatlan_v9/model/assets/_init_cloud.py | 9 +- pyatlan_v9/model/assets/_init_cognite.py | 10 +- pyatlan_v9/model/assets/_init_cognos.py | 20 +- pyatlan_v9/model/assets/_init_connection.py | 2 +- pyatlan_v9/model/assets/_init_context.py | 4 +- .../model/assets/_init_cosmos_mongo_db.py | 8 +- pyatlan_v9/model/assets/_init_cube.py | 8 +- pyatlan_v9/model/assets/_init_custom.py | 5 +- .../model/assets/_init_data_contract.py | 2 +- pyatlan_v9/model/assets/_init_data_mesh.py | 6 +- pyatlan_v9/model/assets/_init_data_quality.py | 2 +- pyatlan_v9/model/assets/_init_data_studio.py | 5 +- pyatlan_v9/model/assets/_init_databricks.py | 18 +- pyatlan_v9/model/assets/_init_dataverse.py | 6 +- pyatlan_v9/model/assets/_init_dbt.py | 18 +- pyatlan_v9/model/assets/_init_document_db.py | 6 +- pyatlan_v9/model/assets/_init_domo.py | 10 +- pyatlan_v9/model/assets/_init_dremio.py | 8 +- pyatlan_v9/model/assets/_init_dynamo_db.py | 4 +- pyatlan_v9/model/assets/_init_fabric.py | 16 +- pyatlan_v9/model/assets/_init_fivetran.py | 5 +- pyatlan_v9/model/assets/_init_flow.py | 16 +- pyatlan_v9/model/assets/_init_form.py | 5 +- pyatlan_v9/model/assets/_init_gcp_dataplex.py | 5 +- pyatlan_v9/model/assets/_init_gcs.py | 6 +- pyatlan_v9/model/assets/_init_gtc.py | 6 +- pyatlan_v9/model/assets/_init_iceberg.py | 8 +- pyatlan_v9/model/assets/_init_kafka.py | 8 +- pyatlan_v9/model/assets/_init_knowledge.py | 6 +- pyatlan_v9/model/assets/_init_looker.py | 18 +- pyatlan_v9/model/assets/_init_matillion.py | 10 +- pyatlan_v9/model/assets/_init_metabase.py | 8 +- .../model/assets/_init_micro_strategy.py | 18 +- pyatlan_v9/model/assets/_init_mode.py | 8 +- pyatlan_v9/model/assets/_init_model.py | 12 +- pyatlan_v9/model/assets/_init_mongo_db.py | 6 +- pyatlan_v9/model/assets/_init_monte_carlo.py | 8 +- pyatlan_v9/model/assets/_init_namespace.py | 8 +- pyatlan_v9/model/assets/_init_notebook.py | 2 +- pyatlan_v9/model/assets/_init_partial.py | 6 +- pyatlan_v9/model/assets/_init_power_bi.py | 20 +- pyatlan_v9/model/assets/_init_preset.py | 8 +- pyatlan_v9/model/assets/_init_process.py | 6 +- pyatlan_v9/model/assets/_init_qlik.py | 10 +- pyatlan_v9/model/assets/_init_quick_sight.py | 16 +- pyatlan_v9/model/assets/_init_redash.py | 6 +- .../model/assets/_init_referenceable.py | 4 +- pyatlan_v9/model/assets/_init_resource.py | 12 +- pyatlan_v9/model/assets/_init_s3.py | 7 +- pyatlan_v9/model/assets/_init_sage_maker.py | 12 +- .../assets/_init_sage_maker_unified_studio.py | 14 +- pyatlan_v9/model/assets/_init_salesforce.py | 10 +- pyatlan_v9/model/assets/_init_sap.py | 28 +- .../model/assets/_init_sap_analytics_cloud.py | 8 +- pyatlan_v9/model/assets/_init_sapbw.py | 24 +- .../model/assets/_init_schema_registry.py | 2 +- pyatlan_v9/model/assets/_init_semantic.py | 12 +- pyatlan_v9/model/assets/_init_sigma.py | 16 +- pyatlan_v9/model/assets/_init_sisense.py | 10 +- pyatlan_v9/model/assets/_init_skill.py | 2 +- .../model/assets/_init_skill_artifact.py | 2 +- pyatlan_v9/model/assets/_init_snowflake.py | 8 +- pyatlan_v9/model/assets/_init_soda.py | 5 +- pyatlan_v9/model/assets/_init_spark.py | 5 +- pyatlan_v9/model/assets/_init_sql.py | 20 +- pyatlan_v9/model/assets/_init_sql_insight.py | 8 +- pyatlan_v9/model/assets/_init_ssrs.py | 8 +- pyatlan_v9/model/assets/_init_starburst.py | 6 +- pyatlan_v9/model/assets/_init_superset.py | 8 +- pyatlan_v9/model/assets/_init_tableau.py | 18 +- pyatlan_v9/model/assets/_init_tag.py | 8 +- pyatlan_v9/model/assets/_init_task.py | 2 +- pyatlan_v9/model/assets/_init_thoughtspot.py | 10 +- pyatlan_v9/model/assets/_init_unstructured.py | 8 +- pyatlan_v9/model/assets/_init_workflow.py | 5 +- pyatlan_v9/model/assets/access_control.py | 73 +- pyatlan_v9/model/assets/adf.py | 78 +- pyatlan_v9/model/assets/adf_activity.py | 85 +- pyatlan_v9/model/assets/adf_dataflow.py | 90 +- pyatlan_v9/model/assets/adf_dataset.py | 90 +- pyatlan_v9/model/assets/adf_linkedservice.py | 85 +- pyatlan_v9/model/assets/adf_pipeline.py | 85 +- pyatlan_v9/model/assets/adls.py | 73 +- pyatlan_v9/model/assets/adls_account.py | 75 +- pyatlan_v9/model/assets/adls_container.py | 75 +- pyatlan_v9/model/assets/adls_object.py | 77 +- pyatlan_v9/model/assets/agent.py | 73 +- pyatlan_v9/model/assets/agentic.py | 73 +- pyatlan_v9/model/assets/ai.py | 78 +- pyatlan_v9/model/assets/ai_application.py | 84 +- pyatlan_v9/model/assets/ai_model.py | 87 +- pyatlan_v9/model/assets/ai_model_version.py | 78 +- pyatlan_v9/model/assets/airflow.py | 73 +- pyatlan_v9/model/assets/airflow_dag.py | 75 +- pyatlan_v9/model/assets/airflow_task.py | 75 +- pyatlan_v9/model/assets/anaplan.py | 78 +- pyatlan_v9/model/assets/anaplan_app.py | 80 +- pyatlan_v9/model/assets/anaplan_dimension.py | 92 +- pyatlan_v9/model/assets/anaplan_line_item.py | 92 +- pyatlan_v9/model/assets/anaplan_list.py | 85 +- pyatlan_v9/model/assets/anaplan_model.py | 96 +- pyatlan_v9/model/assets/anaplan_module.py | 92 +- pyatlan_v9/model/assets/anaplan_page.py | 82 +- .../model/assets/anaplan_system_dimension.py | 80 +- pyatlan_v9/model/assets/anaplan_view.py | 90 +- pyatlan_v9/model/assets/anaplan_workspace.py | 75 +- pyatlan_v9/model/assets/anomalo.py | 73 +- pyatlan_v9/model/assets/anomalo_check.py | 73 +- pyatlan_v9/model/assets/api.py | 73 +- pyatlan_v9/model/assets/api_field.py | 75 +- pyatlan_v9/model/assets/api_object.py | 75 +- pyatlan_v9/model/assets/api_path.py | 75 +- pyatlan_v9/model/assets/api_query.py | 75 +- pyatlan_v9/model/assets/api_spec.py | 75 +- pyatlan_v9/model/assets/app.py | 78 +- pyatlan_v9/model/assets/app_workflow_run.py | 73 +- pyatlan_v9/model/assets/application.py | 80 +- pyatlan_v9/model/assets/application_field.py | 80 +- pyatlan_v9/model/assets/artifact.py | 73 +- pyatlan_v9/model/assets/asset.py | 77 +- pyatlan_v9/model/assets/asset_grouping.py | 78 +- .../model/assets/asset_grouping_collection.py | 84 +- .../model/assets/asset_grouping_related.py | 1 - .../model/assets/asset_grouping_strategy.py | 84 +- pyatlan_v9/model/assets/atlan_app.py | 81 +- .../model/assets/atlan_app_deployment.py | 81 +- .../model/assets/atlan_app_installed.py | 81 +- pyatlan_v9/model/assets/atlan_app_tool.py | 81 +- pyatlan_v9/model/assets/atlan_app_workflow.py | 81 +- pyatlan_v9/model/assets/atlas_glossary.py | 31 +- .../model/assets/atlas_glossary_category.py | 85 +- .../model/assets/atlas_glossary_term.py | 85 +- pyatlan_v9/model/assets/auth_policy.py | 75 +- pyatlan_v9/model/assets/auth_service.py | 73 +- pyatlan_v9/model/assets/aws.py | 73 +- pyatlan_v9/model/assets/azure.py | 73 +- pyatlan_v9/model/assets/azure_service_bus.py | 73 +- .../assets/azure_service_bus_namespace.py | 79 +- .../model/assets/azure_service_bus_schema.py | 79 +- .../model/assets/azure_service_bus_topic.py | 81 +- pyatlan_v9/model/assets/bi.py | 78 +- pyatlan_v9/model/assets/bi_process.py | 73 +- pyatlan_v9/model/assets/bigquery_routine.py | 73 +- pyatlan_v9/model/assets/business_policy.py | 79 +- pyatlan_v9/model/assets/calculation_view.py | 71 +- pyatlan_v9/model/assets/cassandra.py | 78 +- pyatlan_v9/model/assets/cassandra_column.py | 81 +- pyatlan_v9/model/assets/cassandra_index.py | 78 +- pyatlan_v9/model/assets/cassandra_keyspace.py | 81 +- pyatlan_v9/model/assets/cassandra_table.py | 83 +- pyatlan_v9/model/assets/cassandra_view.py | 81 +- pyatlan_v9/model/assets/catalog.py | 78 +- pyatlan_v9/model/assets/cloud.py | 78 +- pyatlan_v9/model/assets/cognite.py | 78 +- pyatlan_v9/model/assets/cognite3d_model.py | 78 +- pyatlan_v9/model/assets/cognite_asset.py | 92 +- pyatlan_v9/model/assets/cognite_event.py | 78 +- pyatlan_v9/model/assets/cognite_file.py | 78 +- pyatlan_v9/model/assets/cognite_related.py | 1 - pyatlan_v9/model/assets/cognite_sequence.py | 78 +- .../model/assets/cognite_time_series.py | 78 +- pyatlan_v9/model/assets/cognos.py | 73 +- pyatlan_v9/model/assets/cognos_column.py | 89 +- pyatlan_v9/model/assets/cognos_dashboard.py | 81 +- pyatlan_v9/model/assets/cognos_dataset.py | 81 +- pyatlan_v9/model/assets/cognos_datasource.py | 73 +- pyatlan_v9/model/assets/cognos_exploration.py | 81 +- pyatlan_v9/model/assets/cognos_file.py | 73 +- pyatlan_v9/model/assets/cognos_folder.py | 91 +- pyatlan_v9/model/assets/cognos_module.py | 81 +- pyatlan_v9/model/assets/cognos_package.py | 81 +- pyatlan_v9/model/assets/cognos_report.py | 73 +- pyatlan_v9/model/assets/collection.py | 83 +- pyatlan_v9/model/assets/column.py | 77 +- pyatlan_v9/model/assets/column_process.py | 75 +- pyatlan_v9/model/assets/connection.py | 82 +- pyatlan_v9/model/assets/context.py | 73 +- pyatlan_v9/model/assets/context_artifact.py | 73 +- pyatlan_v9/model/assets/context_repository.py | 73 +- pyatlan_v9/model/assets/cosmos_mongo_db.py | 78 +- .../model/assets/cosmos_mongo_db_account.py | 79 +- .../assets/cosmos_mongo_db_collection.py | 79 +- .../model/assets/cosmos_mongo_db_database.py | 81 +- pyatlan_v9/model/assets/cube.py | 73 +- pyatlan_v9/model/assets/cube_dimension.py | 73 +- pyatlan_v9/model/assets/cube_field.py | 73 +- pyatlan_v9/model/assets/cube_hierarchy.py | 73 +- pyatlan_v9/model/assets/custom.py | 78 +- pyatlan_v9/model/assets/custom_entity.py | 80 +- pyatlan_v9/model/assets/data_contract.py | 81 +- pyatlan_v9/model/assets/data_domain.py | 75 +- pyatlan_v9/model/assets/data_mesh.py | 73 +- pyatlan_v9/model/assets/data_mesh_dataset.py | 73 +- pyatlan_v9/model/assets/data_product.py | 91 +- pyatlan_v9/model/assets/data_quality.py | 81 +- pyatlan_v9/model/assets/data_quality_rule.py | 113 +- .../assets/data_quality_rule_template.py | 81 +- pyatlan_v9/model/assets/data_set.py | 71 +- pyatlan_v9/model/assets/data_studio.py | 73 +- pyatlan_v9/model/assets/data_studio_asset.py | 75 +- pyatlan_v9/model/assets/database.py | 73 +- pyatlan_v9/model/assets/databricks.py | 73 +- .../assets/databricks_ai_model_context.py | 79 +- .../assets/databricks_ai_model_version.py | 79 +- .../model/assets/databricks_dashboard.py | 73 +- .../assets/databricks_external_location.py | 79 +- .../databricks_external_location_path.py | 79 +- .../model/assets/databricks_genie_agent.py | 73 +- .../model/assets/databricks_metric_view.py | 73 +- .../model/assets/databricks_notebook.py | 73 +- pyatlan_v9/model/assets/databricks_volume.py | 73 +- .../model/assets/databricks_volume_path.py | 73 +- pyatlan_v9/model/assets/dataverse.py | 73 +- .../model/assets/dataverse_attribute.py | 75 +- pyatlan_v9/model/assets/dataverse_entity.py | 75 +- pyatlan_v9/model/assets/dbt.py | 73 +- pyatlan_v9/model/assets/dbt_column_process.py | 73 +- pyatlan_v9/model/assets/dbt_dimension.py | 73 +- pyatlan_v9/model/assets/dbt_entity.py | 73 +- pyatlan_v9/model/assets/dbt_measure.py | 73 +- pyatlan_v9/model/assets/dbt_metric.py | 73 +- pyatlan_v9/model/assets/dbt_model.py | 83 +- pyatlan_v9/model/assets/dbt_model_column.py | 83 +- pyatlan_v9/model/assets/dbt_process.py | 73 +- pyatlan_v9/model/assets/dbt_seed.py | 73 +- pyatlan_v9/model/assets/dbt_semantic_model.py | 73 +- pyatlan_v9/model/assets/dbt_source.py | 73 +- pyatlan_v9/model/assets/dbt_tag.py | 73 +- pyatlan_v9/model/assets/dbt_test.py | 83 +- pyatlan_v9/model/assets/document_db.py | 78 +- .../model/assets/document_db_collection.py | 75 +- .../model/assets/document_db_database.py | 75 +- pyatlan_v9/model/assets/domo.py | 78 +- pyatlan_v9/model/assets/domo_card.py | 73 +- pyatlan_v9/model/assets/domo_dashboard.py | 73 +- pyatlan_v9/model/assets/domo_dataset.py | 73 +- .../model/assets/domo_dataset_column.py | 73 +- pyatlan_v9/model/assets/dremio.py | 73 +- pyatlan_v9/model/assets/dremio_column.py | 73 +- pyatlan_v9/model/assets/dremio_folder.py | 85 +- .../model/assets/dremio_physical_dataset.py | 81 +- pyatlan_v9/model/assets/dremio_source.py | 81 +- pyatlan_v9/model/assets/dremio_space.py | 81 +- .../model/assets/dremio_virtual_dataset.py | 81 +- pyatlan_v9/model/assets/dynamo_db.py | 73 +- .../model/assets/dynamo_db_attribute.py | 73 +- .../model/assets/dynamo_db_secondary_index.py | 73 +- pyatlan_v9/model/assets/dynamo_db_table.py | 83 +- pyatlan_v9/model/assets/entity.py | 33 +- pyatlan_v9/model/assets/event_store.py | 78 +- pyatlan_v9/model/assets/fabric.py | 73 +- pyatlan_v9/model/assets/fabric_activity.py | 73 +- pyatlan_v9/model/assets/fabric_dashboard.py | 73 +- .../model/assets/fabric_data_pipeline.py | 81 +- pyatlan_v9/model/assets/fabric_dataflow.py | 81 +- .../assets/fabric_dataflow_entity_column.py | 73 +- pyatlan_v9/model/assets/fabric_page.py | 73 +- pyatlan_v9/model/assets/fabric_report.py | 81 +- .../model/assets/fabric_semantic_model.py | 81 +- .../assets/fabric_semantic_model_measure.py | 81 +- .../assets/fabric_semantic_model_table.py | 83 +- .../fabric_semantic_model_table_column.py | 81 +- pyatlan_v9/model/assets/fabric_visual.py | 73 +- pyatlan_v9/model/assets/fabric_workspace.py | 87 +- pyatlan_v9/model/assets/file.py | 75 +- pyatlan_v9/model/assets/fivetran.py | 73 +- pyatlan_v9/model/assets/fivetran_connector.py | 73 +- pyatlan_v9/model/assets/flow.py | 73 +- .../model/assets/flow_control_operation.py | 73 +- pyatlan_v9/model/assets/flow_dataset.py | 73 +- .../model/assets/flow_dataset_operation.py | 81 +- pyatlan_v9/model/assets/flow_field.py | 73 +- .../model/assets/flow_field_operation.py | 73 +- pyatlan_v9/model/assets/flow_folder.py | 73 +- pyatlan_v9/model/assets/flow_project.py | 73 +- pyatlan_v9/model/assets/flow_reusable_unit.py | 81 +- pyatlan_v9/model/assets/folder.py | 75 +- pyatlan_v9/model/assets/form.py | 78 +- pyatlan_v9/model/assets/function.py | 71 +- pyatlan_v9/model/assets/gcp_dataplex.py | 73 +- .../model/assets/gcp_dataplex_aspect_type.py | 73 +- pyatlan_v9/model/assets/gcs.py | 73 +- pyatlan_v9/model/assets/gcs_bucket.py | 75 +- pyatlan_v9/model/assets/gcs_object.py | 77 +- pyatlan_v9/model/assets/google.py | 73 +- pyatlan_v9/model/assets/iceberg.py | 73 +- pyatlan_v9/model/assets/iceberg_catalog.py | 73 +- pyatlan_v9/model/assets/iceberg_column.py | 73 +- pyatlan_v9/model/assets/iceberg_namespace.py | 73 +- pyatlan_v9/model/assets/iceberg_table.py | 73 +- pyatlan_v9/model/assets/incident.py | 71 +- pyatlan_v9/model/assets/infrastructure.py | 71 +- pyatlan_v9/model/assets/insight.py | 78 +- pyatlan_v9/model/assets/kafka.py | 78 +- pyatlan_v9/model/assets/kafka_cluster.py | 73 +- .../model/assets/kafka_consumer_group.py | 75 +- pyatlan_v9/model/assets/kafka_field.py | 73 +- pyatlan_v9/model/assets/kafka_tag.py | 73 +- pyatlan_v9/model/assets/kafka_topic.py | 85 +- pyatlan_v9/model/assets/knowledge.py | 73 +- pyatlan_v9/model/assets/knowledge_file.py | 73 +- pyatlan_v9/model/assets/knowledge_folder.py | 73 +- pyatlan_v9/model/assets/link.py | 73 +- pyatlan_v9/model/assets/looker.py | 78 +- pyatlan_v9/model/assets/looker_dashboard.py | 85 +- pyatlan_v9/model/assets/looker_explore.py | 88 +- pyatlan_v9/model/assets/looker_field.py | 89 +- pyatlan_v9/model/assets/looker_folder.py | 81 +- pyatlan_v9/model/assets/looker_look.py | 89 +- pyatlan_v9/model/assets/looker_model.py | 92 +- pyatlan_v9/model/assets/looker_project.py | 90 +- pyatlan_v9/model/assets/looker_query.py | 88 +- pyatlan_v9/model/assets/looker_tile.py | 85 +- pyatlan_v9/model/assets/looker_view.py | 78 +- pyatlan_v9/model/assets/materialised_view.py | 73 +- pyatlan_v9/model/assets/matillion.py | 78 +- .../model/assets/matillion_component.py | 73 +- pyatlan_v9/model/assets/matillion_group.py | 73 +- pyatlan_v9/model/assets/matillion_job.py | 81 +- pyatlan_v9/model/assets/matillion_project.py | 81 +- pyatlan_v9/model/assets/mc_incident.py | 73 +- pyatlan_v9/model/assets/mc_monitor.py | 73 +- pyatlan_v9/model/assets/metabase.py | 73 +- .../model/assets/metabase_collection.py | 83 +- pyatlan_v9/model/assets/metabase_dashboard.py | 83 +- pyatlan_v9/model/assets/metabase_question.py | 83 +- pyatlan_v9/model/assets/metric.py | 73 +- pyatlan_v9/model/assets/micro_strategy.py | 73 +- .../model/assets/micro_strategy_attribute.py | 87 +- .../model/assets/micro_strategy_column.py | 89 +- .../model/assets/micro_strategy_cube.py | 85 +- .../model/assets/micro_strategy_document.py | 81 +- .../model/assets/micro_strategy_dossier.py | 83 +- .../model/assets/micro_strategy_fact.py | 83 +- .../model/assets/micro_strategy_metric.py | 89 +- .../model/assets/micro_strategy_project.py | 89 +- .../model/assets/micro_strategy_report.py | 85 +- .../assets/micro_strategy_visualization.py | 81 +- pyatlan_v9/model/assets/mode.py | 73 +- pyatlan_v9/model/assets/mode_chart.py | 73 +- pyatlan_v9/model/assets/mode_collection.py | 73 +- pyatlan_v9/model/assets/mode_query.py | 73 +- pyatlan_v9/model/assets/mode_report.py | 73 +- pyatlan_v9/model/assets/mode_workspace.py | 73 +- pyatlan_v9/model/assets/model.py | 73 +- pyatlan_v9/model/assets/model_attribute.py | 81 +- .../assets/model_attribute_association.py | 81 +- pyatlan_v9/model/assets/model_data_model.py | 83 +- pyatlan_v9/model/assets/model_entity.py | 83 +- .../model/assets/model_entity_association.py | 81 +- pyatlan_v9/model/assets/model_version.py | 83 +- pyatlan_v9/model/assets/mongo_db.py | 78 +- .../model/assets/mongo_db_collection.py | 73 +- pyatlan_v9/model/assets/mongo_db_database.py | 73 +- pyatlan_v9/model/assets/monte_carlo.py | 73 +- .../model/assets/multi_dimensional_dataset.py | 73 +- pyatlan_v9/model/assets/namespace.py | 73 +- pyatlan_v9/model/assets/no_sql.py | 78 +- pyatlan_v9/model/assets/notebook.py | 78 +- pyatlan_v9/model/assets/notebook_related.py | 1 - pyatlan_v9/model/assets/object_store.py | 78 +- .../model/assets/orchestration_related.py | 1 - pyatlan_v9/model/assets/partial.py | 78 +- pyatlan_v9/model/assets/partial_field.py | 78 +- pyatlan_v9/model/assets/partial_object.py | 78 +- pyatlan_v9/model/assets/persona.py | 93 +- pyatlan_v9/model/assets/power_bi.py | 73 +- pyatlan_v9/model/assets/power_bi_app.py | 81 +- pyatlan_v9/model/assets/power_bi_column.py | 81 +- pyatlan_v9/model/assets/power_bi_dashboard.py | 83 +- pyatlan_v9/model/assets/power_bi_dataflow.py | 83 +- .../assets/power_bi_dataflow_entity_column.py | 73 +- pyatlan_v9/model/assets/power_bi_dataset.py | 83 +- .../model/assets/power_bi_datasource.py | 81 +- pyatlan_v9/model/assets/power_bi_measure.py | 81 +- pyatlan_v9/model/assets/power_bi_page.py | 73 +- pyatlan_v9/model/assets/power_bi_report.py | 83 +- pyatlan_v9/model/assets/power_bi_table.py | 83 +- pyatlan_v9/model/assets/power_bi_tile.py | 83 +- pyatlan_v9/model/assets/power_bi_workspace.py | 83 +- pyatlan_v9/model/assets/preset.py | 73 +- pyatlan_v9/model/assets/preset_chart.py | 75 +- pyatlan_v9/model/assets/preset_dashboard.py | 85 +- pyatlan_v9/model/assets/preset_dataset.py | 75 +- pyatlan_v9/model/assets/preset_workspace.py | 75 +- pyatlan_v9/model/assets/procedure.py | 73 +- pyatlan_v9/model/assets/process.py | 75 +- pyatlan_v9/model/assets/process_execution.py | 71 +- pyatlan_v9/model/assets/purpose.py | 91 +- pyatlan_v9/model/assets/qlik.py | 73 +- pyatlan_v9/model/assets/qlik_app.py | 73 +- pyatlan_v9/model/assets/qlik_chart.py | 73 +- pyatlan_v9/model/assets/qlik_column.py | 81 +- pyatlan_v9/model/assets/qlik_dataset.py | 73 +- pyatlan_v9/model/assets/qlik_sheet.py | 81 +- pyatlan_v9/model/assets/qlik_space.py | 73 +- pyatlan_v9/model/assets/query.py | 75 +- pyatlan_v9/model/assets/quick_sight.py | 73 +- .../model/assets/quick_sight_analysis.py | 83 +- .../assets/quick_sight_analysis_visual.py | 81 +- .../model/assets/quick_sight_dashboard.py | 83 +- .../assets/quick_sight_dashboard_visual.py | 81 +- .../model/assets/quick_sight_dataset.py | 83 +- .../model/assets/quick_sight_dataset_field.py | 75 +- pyatlan_v9/model/assets/quick_sight_folder.py | 83 +- pyatlan_v9/model/assets/readme.py | 75 +- pyatlan_v9/model/assets/readme_template.py | 77 +- pyatlan_v9/model/assets/redash.py | 73 +- pyatlan_v9/model/assets/redash_dashboard.py | 73 +- pyatlan_v9/model/assets/redash_query.py | 73 +- .../model/assets/redash_visualization.py | 73 +- pyatlan_v9/model/assets/referenceable.py | 100 +- pyatlan_v9/model/assets/resource.py | 73 +- pyatlan_v9/model/assets/s3.py | 73 +- pyatlan_v9/model/assets/s3_bucket.py | 75 +- pyatlan_v9/model/assets/s3_object.py | 77 +- pyatlan_v9/model/assets/s3_prefix.py | 73 +- pyatlan_v9/model/assets/saa_s.py | 78 +- pyatlan_v9/model/assets/sage_maker.py | 73 +- pyatlan_v9/model/assets/sage_maker_feature.py | 73 +- .../model/assets/sage_maker_feature_group.py | 73 +- pyatlan_v9/model/assets/sage_maker_model.py | 77 +- .../assets/sage_maker_model_deployment.py | 73 +- .../model/assets/sage_maker_model_group.py | 73 +- .../model/assets/sage_maker_unified_studio.py | 78 +- .../assets/sage_maker_unified_studio_asset.py | 82 +- .../sage_maker_unified_studio_asset_schema.py | 82 +- .../sage_maker_unified_studio_project.py | 82 +- ...ge_maker_unified_studio_published_asset.py | 77 +- ...e_maker_unified_studio_subscribed_asset.py | 77 +- pyatlan_v9/model/assets/salesforce.py | 78 +- .../model/assets/salesforce_dashboard.py | 77 +- pyatlan_v9/model/assets/salesforce_field.py | 73 +- pyatlan_v9/model/assets/salesforce_object.py | 77 +- .../model/assets/salesforce_organization.py | 82 +- pyatlan_v9/model/assets/salesforce_report.py | 82 +- pyatlan_v9/model/assets/sap.py | 73 +- .../model/assets/sap_analytics_cloud.py | 73 +- .../assets/sap_analytics_cloud_column.py | 79 +- .../assets/sap_analytics_cloud_folder.py | 77 +- .../model/assets/sap_analytics_cloud_model.py | 77 +- .../model/assets/sap_analytics_cloud_story.py | 77 +- pyatlan_v9/model/assets/sap_column_process.py | 73 +- .../assets/sap_datasphere_replication_flow.py | 73 +- .../model/assets/sap_erp_abap_program.py | 77 +- pyatlan_v9/model/assets/sap_erp_cds_view.py | 77 +- pyatlan_v9/model/assets/sap_erp_column.py | 83 +- pyatlan_v9/model/assets/sap_erp_component.py | 77 +- pyatlan_v9/model/assets/sap_erp_fiori_app.py | 73 +- .../model/assets/sap_erp_function_module.py | 77 +- pyatlan_v9/model/assets/sap_erp_table.py | 73 +- .../model/assets/sap_erp_transaction_code.py | 77 +- pyatlan_v9/model/assets/sap_erp_view.py | 73 +- pyatlan_v9/model/assets/sap_process.py | 73 +- pyatlan_v9/model/assets/sapbw.py | 73 +- .../model/assets/sapbw_composite_provider.py | 77 +- .../assets/sapbw_composite_provider_field.py | 77 +- pyatlan_v9/model/assets/sapbw_data_source.py | 73 +- .../model/assets/sapbw_data_source_field.py | 77 +- pyatlan_v9/model/assets/sapbw_info_area.py | 77 +- pyatlan_v9/model/assets/sapbw_info_object.py | 77 +- pyatlan_v9/model/assets/sapbw_info_source.py | 77 +- .../model/assets/sapbw_info_source_field.py | 77 +- pyatlan_v9/model/assets/sapbw_query.py | 77 +- .../model/assets/sapbw_query_element.py | 77 +- .../model/assets/sapbw_transformation.py | 73 +- pyatlan_v9/model/assets/sapbwadso.py | 77 +- pyatlan_v9/model/assets/sapbwadso_field.py | 77 +- pyatlan_v9/model/assets/sapbwdtp.py | 73 +- pyatlan_v9/model/assets/schema.py | 73 +- pyatlan_v9/model/assets/schema_registry.py | 78 +- .../model/assets/schema_registry_subject.py | 75 +- .../model/assets/schema_registry_version.py | 75 +- pyatlan_v9/model/assets/semantic.py | 78 +- pyatlan_v9/model/assets/semantic_dimension.py | 73 +- pyatlan_v9/model/assets/semantic_entity.py | 73 +- pyatlan_v9/model/assets/semantic_field.py | 73 +- pyatlan_v9/model/assets/semantic_measure.py | 73 +- pyatlan_v9/model/assets/semantic_model.py | 80 +- pyatlan_v9/model/assets/sigma.py | 73 +- pyatlan_v9/model/assets/sigma_data_element.py | 75 +- .../model/assets/sigma_data_element_field.py | 73 +- pyatlan_v9/model/assets/sigma_data_model.py | 73 +- .../model/assets/sigma_data_model_column.py | 73 +- pyatlan_v9/model/assets/sigma_dataset.py | 73 +- .../model/assets/sigma_dataset_column.py | 73 +- pyatlan_v9/model/assets/sigma_page.py | 75 +- pyatlan_v9/model/assets/sigma_workbook.py | 73 +- pyatlan_v9/model/assets/sisense.py | 78 +- pyatlan_v9/model/assets/sisense_dashboard.py | 75 +- pyatlan_v9/model/assets/sisense_datamodel.py | 75 +- .../model/assets/sisense_datamodel_table.py | 75 +- pyatlan_v9/model/assets/sisense_folder.py | 75 +- pyatlan_v9/model/assets/sisense_widget.py | 75 +- pyatlan_v9/model/assets/skill.py | 73 +- pyatlan_v9/model/assets/skill_artifact.py | 73 +- pyatlan_v9/model/assets/snowflake.py | 73 +- .../assets/snowflake_ai_model_context.py | 81 +- .../assets/snowflake_ai_model_version.py | 81 +- pyatlan_v9/model/assets/snowflake_listing.py | 81 +- .../assets/snowflake_semantic_dimension.py | 79 +- .../model/assets/snowflake_semantic_fact.py | 79 +- .../snowflake_semantic_logical_table.py | 85 +- .../model/assets/snowflake_semantic_metric.py | 79 +- .../model/assets/snowflake_semantic_view.py | 79 +- pyatlan_v9/model/assets/snowflake_share.py | 81 +- pyatlan_v9/model/assets/soda.py | 73 +- pyatlan_v9/model/assets/soda_check.py | 73 +- pyatlan_v9/model/assets/source_tag.py | 71 +- pyatlan_v9/model/assets/spark.py | 71 +- pyatlan_v9/model/assets/spark_job.py | 71 +- pyatlan_v9/model/assets/sql.py | 71 +- pyatlan_v9/model/assets/sql_insight.py | 76 +- .../assets/sql_insight_business_question.py | 73 +- pyatlan_v9/model/assets/sql_insight_filter.py | 73 +- pyatlan_v9/model/assets/sql_insight_join.py | 73 +- pyatlan_v9/model/assets/ssrs.py | 71 +- pyatlan_v9/model/assets/ssrs_data_set.py | 71 +- pyatlan_v9/model/assets/ssrs_field.py | 71 +- pyatlan_v9/model/assets/ssrs_folder.py | 71 +- pyatlan_v9/model/assets/ssrs_report.py | 71 +- pyatlan_v9/model/assets/starburst.py | 71 +- pyatlan_v9/model/assets/starburst_dataset.py | 71 +- .../model/assets/starburst_dataset_column.py | 71 +- pyatlan_v9/model/assets/superset.py | 71 +- pyatlan_v9/model/assets/superset_chart.py | 73 +- pyatlan_v9/model/assets/superset_dashboard.py | 73 +- pyatlan_v9/model/assets/superset_dataset.py | 73 +- pyatlan_v9/model/assets/table.py | 73 +- pyatlan_v9/model/assets/table_partition.py | 73 +- pyatlan_v9/model/assets/tableau.py | 76 +- .../model/assets/tableau_calculated_field.py | 71 +- pyatlan_v9/model/assets/tableau_dashboard.py | 76 +- .../model/assets/tableau_dashboard_field.py | 71 +- pyatlan_v9/model/assets/tableau_datasource.py | 71 +- .../model/assets/tableau_datasource_field.py | 71 +- pyatlan_v9/model/assets/tableau_flow.py | 76 +- pyatlan_v9/model/assets/tableau_metric.py | 76 +- pyatlan_v9/model/assets/tableau_project.py | 71 +- pyatlan_v9/model/assets/tableau_site.py | 76 +- pyatlan_v9/model/assets/tableau_workbook.py | 76 +- pyatlan_v9/model/assets/tableau_worksheet.py | 76 +- .../model/assets/tableau_worksheet_field.py | 71 +- pyatlan_v9/model/assets/tag.py | 71 +- pyatlan_v9/model/assets/task.py | 71 +- pyatlan_v9/model/assets/thoughtspot.py | 71 +- pyatlan_v9/model/assets/thoughtspot_answer.py | 71 +- pyatlan_v9/model/assets/thoughtspot_column.py | 71 +- .../model/assets/thoughtspot_dashlet.py | 71 +- .../model/assets/thoughtspot_liveboard.py | 71 +- pyatlan_v9/model/assets/thoughtspot_table.py | 71 +- pyatlan_v9/model/assets/thoughtspot_view.py | 71 +- .../model/assets/thoughtspot_worksheet.py | 71 +- pyatlan_v9/model/assets/unstructured.py | 76 +- .../model/assets/unstructured_container.py | 71 +- .../model/assets/unstructured_folder.py | 71 +- .../model/assets/unstructured_object.py | 71 +- pyatlan_v9/model/assets/view.py | 73 +- pyatlan_v9/model/assets/workflow.py | 71 +- requirements.txt | 304 ---- tests/integration/aio/test_client.py | 2 +- tests/integration/test_app_client.py | 6 +- tests/unit/test_app_client.py | 5 +- tests/unit/test_core.py | 1 - 629 files changed, 19653 insertions(+), 19831 deletions(-) diff --git a/pyatlan/__init__.py b/pyatlan/__init__.py index 9c5d9422d..8e1d2b89f 100644 --- a/pyatlan/__init__.py +++ b/pyatlan/__init__.py @@ -10,7 +10,9 @@ _install_pydantic_v1_perf() -from pyatlan.utils import REQUEST_ID_FILTER # noqa: E402 (perf patch must install first) +from pyatlan.utils import ( + REQUEST_ID_FILTER, # noqa: E402 (perf patch must install first) +) # Version information try: diff --git a/pyatlan/client/aio/app.py b/pyatlan/client/aio/app.py index abbb189b3..26751e6b9 100644 --- a/pyatlan/client/aio/app.py +++ b/pyatlan/client/aio/app.py @@ -43,9 +43,6 @@ is_duplicate_name_conflict, ) from pyatlan.errors import AtlanError, ErrorCode -from pyatlan.model.apps import AppInput -from pyatlan.model.assets import AppWorkflowRun -from pyatlan.model.fluent_search import CompoundQuery, FluentSearch from pyatlan.model.app import ( AppDeleteResponse, AppInfo, @@ -61,7 +58,9 @@ CreateApp, UpdateApp, ) - +from pyatlan.model.apps import AppInput +from pyatlan.model.assets import AppWorkflowRun +from pyatlan.model.fluent_search import CompoundQuery, FluentSearch LOGGER = logging.getLogger(__name__) diff --git a/pyatlan/client/aio/approval_workflow.py b/pyatlan/client/aio/approval_workflow.py index 80203f3d1..196379ec6 100644 --- a/pyatlan/client/aio/approval_workflow.py +++ b/pyatlan/client/aio/approval_workflow.py @@ -13,11 +13,11 @@ AsyncApiCaller, ) from pyatlan.errors import ErrorCode, InvalidRequestError -from pyatlan.model.enums import ApprovalWorkflowRequestType from pyatlan.model.approval_workflow import ( ApprovalWorkflowBulkActionResponse, ApprovalWorkflowRequest, ) +from pyatlan.model.enums import ApprovalWorkflowRequestType def _raise_if_recipient_scoped(err: InvalidRequestError, group_key: str): diff --git a/pyatlan/client/aio/client.py b/pyatlan/client/aio/client.py index 2a9385a85..080064b02 100644 --- a/pyatlan/client/aio/client.py +++ b/pyatlan/client/aio/client.py @@ -34,6 +34,8 @@ AsyncUserCache, ) from pyatlan.client.aio.admin import AsyncAdminClient +from pyatlan.client.aio.app import AsyncAppClient +from pyatlan.client.aio.approval_workflow import AsyncApprovalWorkflowClient from pyatlan.client.aio.asset import AsyncAssetClient from pyatlan.client.aio.audit import AsyncAuditClient from pyatlan.client.aio.contract import AsyncContractClient @@ -45,15 +47,13 @@ from pyatlan.client.aio.oauth_client import AsyncOAuthClient from pyatlan.client.aio.open_lineage import AsyncOpenLineageClient from pyatlan.client.aio.query import AsyncQueryClient +from pyatlan.client.aio.requests import AsyncRequestsClient from pyatlan.client.aio.role import AsyncRoleClient from pyatlan.client.aio.search_log import AsyncSearchLogClient from pyatlan.client.aio.sso import AsyncSSOClient from pyatlan.client.aio.task import AsyncTaskClient -from pyatlan.client.aio.approval_workflow import AsyncApprovalWorkflowClient -from pyatlan.client.aio.requests import AsyncRequestsClient from pyatlan.client.aio.token import AsyncTokenClient from pyatlan.client.aio.typedef import AsyncTypeDefClient -from pyatlan.client.aio.app import AsyncAppClient from pyatlan.client.aio.user import AsyncUserClient from pyatlan.client.atlan import ( CONNECTION_RETRY, diff --git a/pyatlan/client/app.py b/pyatlan/client/app.py index 772b9f56b..629abb9c5 100644 --- a/pyatlan/client/app.py +++ b/pyatlan/client/app.py @@ -37,10 +37,6 @@ is_duplicate_name_conflict, ) from pyatlan.errors import AtlanError, ErrorCode -from pyatlan.model.apps import AppInput -from pyatlan.model.assets import AppWorkflowRun -from pyatlan.model.enums import AppWorkflowRunStatus -from pyatlan.model.fluent_search import CompoundQuery, FluentSearch from pyatlan.model.app import ( AppDeleteResponse, AppInfo, @@ -56,7 +52,10 @@ CreateApp, UpdateApp, ) - +from pyatlan.model.apps import AppInput +from pyatlan.model.assets import AppWorkflowRun +from pyatlan.model.enums import AppWorkflowRunStatus +from pyatlan.model.fluent_search import CompoundQuery, FluentSearch LOGGER = logging.getLogger(__name__) diff --git a/pyatlan/client/approval_workflow.py b/pyatlan/client/approval_workflow.py index c7894cc6f..a3209a72b 100644 --- a/pyatlan/client/approval_workflow.py +++ b/pyatlan/client/approval_workflow.py @@ -13,11 +13,11 @@ ApprovalWorkflowGetRequest, ) from pyatlan.errors import ErrorCode, InvalidRequestError -from pyatlan.model.enums import ApprovalWorkflowRequestType from pyatlan.model.approval_workflow import ( ApprovalWorkflowBulkActionResponse, ApprovalWorkflowRequest, ) +from pyatlan.model.enums import ApprovalWorkflowRequestType def _raise_if_recipient_scoped(err: InvalidRequestError, group_key: str): diff --git a/pyatlan/client/atlan.py b/pyatlan/client/atlan.py index cfd8bf60f..0afcb43fb 100644 --- a/pyatlan/client/atlan.py +++ b/pyatlan/client/atlan.py @@ -39,6 +39,8 @@ from pyatlan.cache.source_tag_cache import SourceTagCache from pyatlan.cache.user_cache import UserCache from pyatlan.client.admin import AdminClient +from pyatlan.client.app import AppClient +from pyatlan.client.approval_workflow import ApprovalWorkflowClient from pyatlan.client.asset import A, AssetClient, IndexSearchResults, LineageListResults from pyatlan.client.audit import AuditClient from pyatlan.client.common import CONNECTION_RETRY, ImpersonateUser @@ -52,7 +54,6 @@ from pyatlan.client.oauth_client import OAuthClient from pyatlan.client.open_lineage import OpenLineageClient from pyatlan.client.query import QueryClient -from pyatlan.client.approval_workflow import ApprovalWorkflowClient from pyatlan.client.requests import RequestsClient from pyatlan.client.role import RoleClient from pyatlan.client.search_log import SearchLogClient @@ -61,7 +62,6 @@ from pyatlan.client.token import TokenClient from pyatlan.client.transport import PyatlanSyncTransport # type: ignore from pyatlan.client.typedef import TypeDefClient -from pyatlan.client.app import AppClient from pyatlan.client.user import UserClient from pyatlan.errors import ERROR_CODE_FOR_HTTP_STATUS, AtlanError, ErrorCode from pyatlan.model.api_tokens import ApiToken, ApiTokenResponse diff --git a/pyatlan/client/common/__init__.py b/pyatlan/client/common/__init__.py index dc36777d2..a9169a794 100644 --- a/pyatlan/client/common/__init__.py +++ b/pyatlan/client/common/__init__.py @@ -24,6 +24,12 @@ # Admin shared logic classes from .admin import AdminGetAdminEvents, AdminGetKeycloakEvents +# Role shared logic classes +from .approval_workflow import ( + ApprovalWorkflowBulkActionRequests, + ApprovalWorkflowGetRequest, +) + # Asset shared logic classes from .asset import ( DeleteByGuid, @@ -116,12 +122,6 @@ # Query shared logic classes from .query import QueryStream - -# Role shared logic classes -from .approval_workflow import ( - ApprovalWorkflowBulkActionRequests, - ApprovalWorkflowGetRequest, -) from .requests import ( RequestsAction, RequestsCreate, diff --git a/pyatlan/client/common/app.py b/pyatlan/client/common/app.py index df5102f79..0a76fa203 100644 --- a/pyatlan/client/common/app.py +++ b/pyatlan/client/common/app.py @@ -13,10 +13,9 @@ import json from typing import Any, Dict, Optional, Tuple -from pyatlan.errors import AtlanError - from pyatlan.client.constants import ( ADD_APP_SCHEDULE, + API, CANCEL_APP_RUN, CREATE_APP_WORKFLOW, DELETE_APP_WORKFLOW, @@ -29,7 +28,7 @@ SUBMIT_APP_WORKFLOW, UPDATE_APP_WORKFLOW, ) -from pyatlan.client.constants import API +from pyatlan.errors import AtlanError from pyatlan.model.app import ( AppDeleteResponse, AppInfo, diff --git a/pyatlan/model/assets/bigquery_tag.py b/pyatlan/model/assets/bigquery_tag.py index 4a40b93bc..9bfc9acb1 100644 --- a/pyatlan/model/assets/bigquery_tag.py +++ b/pyatlan/model/assets/bigquery_tag.py @@ -1156,8 +1156,12 @@ class Attributes(Tag.Attributes): from .core.dbt_seed import DbtSeed # noqa: E402, F401 from .core.dbt_source import DbtSource # noqa: E402, F401 from .core.dbt_test import DbtTest # noqa: E402, F401 -from .core.snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .core.sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .core.snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .core.sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .core.sql_insight_join import SqlInsightJoin # noqa: E402, F401 BigqueryTag.Attributes.update_forward_refs() 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 dba642085..69dcc987b 100644 --- a/pyatlan/model/assets/core/cosmos_mongo_d_b_collection.py +++ b/pyatlan/model/assets/core/cosmos_mongo_d_b_collection.py @@ -2138,8 +2138,12 @@ class Attributes(CosmosMongoDB.Attributes): from .procedure import Procedure # noqa: E402, F401 from .query import Query # noqa: E402, F401 from .schema import Schema # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 from .table import Table # noqa: E402, F401 from .table_partition import TablePartition # noqa: E402, F401 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 26976394f..8adc0d05c 100644 --- a/pyatlan/model/assets/core/cosmos_mongo_d_b_database.py +++ b/pyatlan/model/assets/core/cosmos_mongo_d_b_database.py @@ -1289,6 +1289,10 @@ class Attributes(CosmosMongoDB.Attributes): from .fabric_workspace import FabricWorkspace # noqa: E402, F401 from .mongo_d_b_collection import MongoDBCollection # noqa: E402, F401 from .schema import Schema # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/databricks_a_i_model_context.py b/pyatlan/model/assets/core/databricks_a_i_model_context.py index 1f7693ba6..41f866a8e 100644 --- a/pyatlan/model/assets/core/databricks_a_i_model_context.py +++ b/pyatlan/model/assets/core/databricks_a_i_model_context.py @@ -1370,6 +1370,10 @@ class Attributes(AIModel.Attributes): from .dbt_source import DbtSource # noqa: E402, F401 from .dbt_test import DbtTest # noqa: E402, F401 from .schema import Schema # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/databricks_a_i_model_version.py b/pyatlan/model/assets/core/databricks_a_i_model_version.py index a40eb4f5c..27424b615 100644 --- a/pyatlan/model/assets/core/databricks_a_i_model_version.py +++ b/pyatlan/model/assets/core/databricks_a_i_model_version.py @@ -1670,6 +1670,10 @@ class Attributes(AIModelVersion.Attributes): from .dbt_seed import DbtSeed # noqa: E402, F401 from .dbt_source import DbtSource # noqa: E402, F401 from .dbt_test import DbtTest # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/databricks_genie_agent.py b/pyatlan/model/assets/core/databricks_genie_agent.py index 5e8424ae5..c8873f518 100644 --- a/pyatlan/model/assets/core/databricks_genie_agent.py +++ b/pyatlan/model/assets/core/databricks_genie_agent.py @@ -1319,6 +1319,10 @@ class Attributes(Agent.Attributes): from .dbt_seed import DbtSeed # noqa: E402, F401 from .dbt_source import DbtSource # noqa: E402, F401 from .dbt_test import DbtTest # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/databricks_unity_catalog_tag.py b/pyatlan/model/assets/core/databricks_unity_catalog_tag.py index a1b20e6b0..f785a5224 100644 --- a/pyatlan/model/assets/core/databricks_unity_catalog_tag.py +++ b/pyatlan/model/assets/core/databricks_unity_catalog_tag.py @@ -1086,6 +1086,10 @@ class Attributes(Tag.Attributes): from .dbt_seed import DbtSeed # noqa: E402, F401 from .dbt_source import DbtSource # noqa: E402, F401 from .dbt_test import DbtTest # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/document_d_b_database.py b/pyatlan/model/assets/core/document_d_b_database.py index b8dacecc0..3ccf3d624 100644 --- a/pyatlan/model/assets/core/document_d_b_database.py +++ b/pyatlan/model/assets/core/document_d_b_database.py @@ -1239,6 +1239,10 @@ def creator( from .document_d_b_collection import DocumentDBCollection # noqa: E402, F401 from .fabric_workspace import FabricWorkspace # noqa: E402, F401 from .schema import Schema # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/fabric_dataflow.py b/pyatlan/model/assets/core/fabric_dataflow.py index f2875b088..61366bf35 100644 --- a/pyatlan/model/assets/core/fabric_dataflow.py +++ b/pyatlan/model/assets/core/fabric_dataflow.py @@ -91,5 +91,7 @@ class Attributes(Fabric.Attributes): ) -from .fabric_dataflow_entity_column import FabricDataflowEntityColumn # noqa: E402, F401 +from .fabric_dataflow_entity_column import ( + FabricDataflowEntityColumn, # noqa: E402, F401 +) from .fabric_workspace import FabricWorkspace # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/fabric_semantic_model_table.py b/pyatlan/model/assets/core/fabric_semantic_model_table.py index 07ed8235c..502c73357 100644 --- a/pyatlan/model/assets/core/fabric_semantic_model_table.py +++ b/pyatlan/model/assets/core/fabric_semantic_model_table.py @@ -132,4 +132,6 @@ class Attributes(Fabric.Attributes): from .fabric_semantic_model import FabricSemanticModel # noqa: E402, F401 -from .fabric_semantic_model_table_column import FabricSemanticModelTableColumn # noqa: E402, F401 +from .fabric_semantic_model_table_column import ( + FabricSemanticModelTableColumn, # noqa: E402, F401 +) diff --git a/pyatlan/model/assets/core/power_b_i_dataflow.py b/pyatlan/model/assets/core/power_b_i_dataflow.py index 060d743b3..38d2bfc0d 100644 --- a/pyatlan/model/assets/core/power_b_i_dataflow.py +++ b/pyatlan/model/assets/core/power_b_i_dataflow.py @@ -354,7 +354,9 @@ class Attributes(PowerBI.Attributes): ) -from .power_b_i_dataflow_entity_column import PowerBIDataflowEntityColumn # noqa: E402, F401 +from .power_b_i_dataflow_entity_column import ( + PowerBIDataflowEntityColumn, # noqa: E402, F401 +) from .power_b_i_dataset import PowerBIDataset # noqa: E402, F401 from .power_b_i_datasource import PowerBIDatasource # noqa: E402, F401 from .power_b_i_table import PowerBITable # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/s_q_l.py b/pyatlan/model/assets/core/s_q_l.py index f50999d5c..bbe691c32 100644 --- a/pyatlan/model/assets/core/s_q_l.py +++ b/pyatlan/model/assets/core/s_q_l.py @@ -995,6 +995,10 @@ class Attributes(Catalog.Attributes): from .dbt_model import DbtModel # noqa: E402, F401 from .dbt_seed import DbtSeed # noqa: E402, F401 from .dbt_source import DbtSource # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/schema.py b/pyatlan/model/assets/core/schema.py index 544f1379d..75db31ce4 100644 --- a/pyatlan/model/assets/core/schema.py +++ b/pyatlan/model/assets/core/schema.py @@ -621,7 +621,9 @@ def create( from .function import Function # noqa: E402, F401 from .materialised_view import MaterialisedView # noqa: E402, F401 from .procedure import Procedure # noqa: E402, F401 -from .sap_datasphere_replication_flow import SapDatasphereReplicationFlow # noqa: E402, F401 +from .sap_datasphere_replication_flow import ( + SapDatasphereReplicationFlow, # noqa: E402, F401 +) from .snowflake_a_i_model_context import SnowflakeAIModelContext # noqa: E402, F401 from .snowflake_pipe import SnowflakePipe # noqa: E402, F401 from .snowflake_semantic_view import SnowflakeSemanticView # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/snowflake_a_i_model_context.py b/pyatlan/model/assets/core/snowflake_a_i_model_context.py index dd39c9079..ae1242f75 100644 --- a/pyatlan/model/assets/core/snowflake_a_i_model_context.py +++ b/pyatlan/model/assets/core/snowflake_a_i_model_context.py @@ -1340,6 +1340,10 @@ class Attributes(AIModel.Attributes): from .dbt_test import DbtTest # noqa: E402, F401 from .schema import Schema # noqa: E402, F401 from .snowflake_a_i_model_version import SnowflakeAIModelVersion # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/snowflake_a_i_model_version.py b/pyatlan/model/assets/core/snowflake_a_i_model_version.py index 2df16f7da..7769b5bed 100644 --- a/pyatlan/model/assets/core/snowflake_a_i_model_version.py +++ b/pyatlan/model/assets/core/snowflake_a_i_model_version.py @@ -1468,6 +1468,10 @@ class Attributes(AIModelVersion.Attributes): from .dbt_source import DbtSource # noqa: E402, F401 from .dbt_test import DbtTest # noqa: E402, F401 from .snowflake_a_i_model_context import SnowflakeAIModelContext # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/snowflake_semantic_dimension.py b/pyatlan/model/assets/core/snowflake_semantic_dimension.py index 09ae786ef..31cc1f68f 100644 --- a/pyatlan/model/assets/core/snowflake_semantic_dimension.py +++ b/pyatlan/model/assets/core/snowflake_semantic_dimension.py @@ -1278,6 +1278,10 @@ class Attributes(SemanticDimension.Attributes): from .dbt_seed import DbtSeed # noqa: E402, F401 from .dbt_source import DbtSource # noqa: E402, F401 from .dbt_test import DbtTest # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/snowflake_semantic_fact.py b/pyatlan/model/assets/core/snowflake_semantic_fact.py index 07692fedc..87b07735d 100644 --- a/pyatlan/model/assets/core/snowflake_semantic_fact.py +++ b/pyatlan/model/assets/core/snowflake_semantic_fact.py @@ -1072,4 +1072,6 @@ class Attributes(Snowflake.Attributes): from .semantic_model import SemanticModel # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) diff --git a/pyatlan/model/assets/core/snowflake_semantic_logical_table.py b/pyatlan/model/assets/core/snowflake_semantic_logical_table.py index 56e8e1041..b62b3fcdb 100644 --- a/pyatlan/model/assets/core/snowflake_semantic_logical_table.py +++ b/pyatlan/model/assets/core/snowflake_semantic_logical_table.py @@ -1407,5 +1407,7 @@ class Attributes(SemanticEntity.Attributes): from .snowflake_semantic_fact import SnowflakeSemanticFact # noqa: E402, F401 from .snowflake_semantic_metric import SnowflakeSemanticMetric # noqa: E402, F401 from .snowflake_semantic_view import SnowflakeSemanticView # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/core/snowflake_semantic_metric.py b/pyatlan/model/assets/core/snowflake_semantic_metric.py index 1b31a67f0..13d1a0c73 100644 --- a/pyatlan/model/assets/core/snowflake_semantic_metric.py +++ b/pyatlan/model/assets/core/snowflake_semantic_metric.py @@ -1161,4 +1161,6 @@ class Attributes(Snowflake.Attributes): from .asset import Asset # noqa: E402, F401 from .column import Column # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) diff --git a/pyatlan/model/assets/core/snowflake_tag.py b/pyatlan/model/assets/core/snowflake_tag.py index 09a7a4527..4d6276fd5 100644 --- a/pyatlan/model/assets/core/snowflake_tag.py +++ b/pyatlan/model/assets/core/snowflake_tag.py @@ -1105,6 +1105,10 @@ class Attributes(Tag.Attributes): from .dbt_source import DbtSource # noqa: E402, F401 from .dbt_test import DbtTest # noqa: E402, F401 from .schema import Schema # noqa: E402, F401 -from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .sql_insight_join import SqlInsightJoin # noqa: E402, F401 diff --git a/pyatlan/model/assets/databricks_dashboard.py b/pyatlan/model/assets/databricks_dashboard.py index 951be448c..bbe329ae1 100644 --- a/pyatlan/model/assets/databricks_dashboard.py +++ b/pyatlan/model/assets/databricks_dashboard.py @@ -1174,8 +1174,12 @@ class Attributes(BI.Attributes): from .core.dbt_seed import DbtSeed # noqa: E402, F401 from .core.dbt_source import DbtSource # noqa: E402, F401 from .core.dbt_test import DbtTest # noqa: E402, F401 -from .core.snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .core.sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .core.snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .core.sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .core.sql_insight_join import SqlInsightJoin # noqa: E402, F401 DatabricksDashboard.Attributes.update_forward_refs() diff --git a/pyatlan/model/assets/databricks_external_location.py b/pyatlan/model/assets/databricks_external_location.py index 2dcb9ebe2..d581d3cd6 100644 --- a/pyatlan/model/assets/databricks_external_location.py +++ b/pyatlan/model/assets/databricks_external_location.py @@ -115,6 +115,8 @@ class Attributes(Databricks.Attributes): ) -from .databricks_external_location_path import DatabricksExternalLocationPath # noqa: E402, F401 +from .databricks_external_location_path import ( + DatabricksExternalLocationPath, # noqa: E402, F401 +) DatabricksExternalLocation.Attributes.update_forward_refs() diff --git a/pyatlan/model/assets/databricks_notebook.py b/pyatlan/model/assets/databricks_notebook.py index 4b9aa7310..0fd5df117 100644 --- a/pyatlan/model/assets/databricks_notebook.py +++ b/pyatlan/model/assets/databricks_notebook.py @@ -1061,8 +1061,12 @@ class Attributes(Notebook.Attributes): from .core.dbt_seed import DbtSeed # noqa: E402, F401 from .core.dbt_source import DbtSource # noqa: E402, F401 from .core.dbt_test import DbtTest # noqa: E402, F401 -from .core.snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .core.sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .core.snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .core.sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .core.sql_insight_join import SqlInsightJoin # noqa: E402, F401 DatabricksNotebook.Attributes.update_forward_refs() diff --git a/pyatlan/model/assets/dynamo_dbtable.py b/pyatlan/model/assets/dynamo_dbtable.py index a1bb1d424..b7396b1b9 100644 --- a/pyatlan/model/assets/dynamo_dbtable.py +++ b/pyatlan/model/assets/dynamo_dbtable.py @@ -1570,7 +1570,11 @@ class Attributes(Table.Attributes): from .dynamo_d_b_attribute import DynamoDBAttribute # noqa: E402, F401 -from .dynamo_d_b_global_secondary_index import DynamoDBGlobalSecondaryIndex # noqa: E402, F401 -from .dynamo_d_b_local_secondary_index import DynamoDBLocalSecondaryIndex # noqa: E402, F401 +from .dynamo_d_b_global_secondary_index import ( + DynamoDBGlobalSecondaryIndex, # noqa: E402, F401 +) +from .dynamo_d_b_local_secondary_index import ( + DynamoDBLocalSecondaryIndex, # noqa: E402, F401 +) DynamoDBTable.Attributes.update_forward_refs() diff --git a/pyatlan/model/assets/iceberg_namespace.py b/pyatlan/model/assets/iceberg_namespace.py index e77955f58..1a9073421 100644 --- a/pyatlan/model/assets/iceberg_namespace.py +++ b/pyatlan/model/assets/iceberg_namespace.py @@ -1358,13 +1358,19 @@ class Attributes(Iceberg.Attributes): from .core.bigquery_routine import BigqueryRoutine # noqa: E402, F401 from .core.calculation_view import CalculationView # noqa: E402, F401 from .core.database import Database # noqa: E402, F401 -from .core.databricks_a_i_model_context import DatabricksAIModelContext # noqa: E402, F401 +from .core.databricks_a_i_model_context import ( + DatabricksAIModelContext, # noqa: E402, F401 +) from .core.databricks_volume import DatabricksVolume # noqa: E402, F401 from .core.function import Function # noqa: E402, F401 from .core.materialised_view import MaterialisedView # noqa: E402, F401 from .core.procedure import Procedure # noqa: E402, F401 -from .core.sap_datasphere_replication_flow import SapDatasphereReplicationFlow # noqa: E402, F401 -from .core.snowflake_a_i_model_context import SnowflakeAIModelContext # noqa: E402, F401 +from .core.sap_datasphere_replication_flow import ( + SapDatasphereReplicationFlow, # noqa: E402, F401 +) +from .core.snowflake_a_i_model_context import ( + SnowflakeAIModelContext, # noqa: E402, F401 +) from .core.snowflake_dynamic_table import SnowflakeDynamicTable # noqa: E402, F401 from .core.snowflake_pipe import SnowflakePipe # noqa: E402, F401 from .core.snowflake_semantic_view import SnowflakeSemanticView # noqa: E402, F401 diff --git a/pyatlan/model/assets/s_a_p_b_w_composite_provider.py b/pyatlan/model/assets/s_a_p_b_w_composite_provider.py index 072cadc97..86278a48f 100644 --- a/pyatlan/model/assets/s_a_p_b_w_composite_provider.py +++ b/pyatlan/model/assets/s_a_p_b_w_composite_provider.py @@ -132,7 +132,9 @@ class Attributes(SAPBW.Attributes): from .s_a_p_b_w_a_d_s_o import SAPBWADSO # noqa: E402, F401 -from .s_a_p_b_w_composite_provider_field import SAPBWCompositeProviderField # noqa: E402, F401 +from .s_a_p_b_w_composite_provider_field import ( + SAPBWCompositeProviderField, # noqa: E402, F401 +) from .s_a_p_b_w_info_area import SAPBWInfoArea # noqa: E402, F401 SAPBWCompositeProvider.Attributes.update_forward_refs() diff --git a/pyatlan/model/assets/s_a_p_b_w_info_object.py b/pyatlan/model/assets/s_a_p_b_w_info_object.py index 89bf4426a..7ffdd3d25 100644 --- a/pyatlan/model/assets/s_a_p_b_w_info_object.py +++ b/pyatlan/model/assets/s_a_p_b_w_info_object.py @@ -268,7 +268,9 @@ class Attributes(SAPBW.Attributes): from .s_a_p_b_w_a_d_s_o_field import SAPBWADSOField # noqa: E402, F401 -from .s_a_p_b_w_composite_provider_field import SAPBWCompositeProviderField # noqa: E402, F401 +from .s_a_p_b_w_composite_provider_field import ( + SAPBWCompositeProviderField, # noqa: E402, F401 +) from .s_a_p_b_w_data_source_field import SAPBWDataSourceField # noqa: E402, F401 from .s_a_p_b_w_info_area import SAPBWInfoArea # noqa: E402, F401 from .s_a_p_b_w_info_source_field import SAPBWInfoSourceField # noqa: E402, F401 diff --git a/pyatlan/model/assets/sage_maker_unified_studio_asset.py b/pyatlan/model/assets/sage_maker_unified_studio_asset.py index 34361ef66..992f98dce 100644 --- a/pyatlan/model/assets/sage_maker_unified_studio_asset.py +++ b/pyatlan/model/assets/sage_maker_unified_studio_asset.py @@ -166,6 +166,8 @@ class Attributes(SageMakerUnifiedStudio.Attributes): ) -from .sage_maker_unified_studio_asset_schema import SageMakerUnifiedStudioAssetSchema # noqa: E402, F401 +from .sage_maker_unified_studio_asset_schema import ( + SageMakerUnifiedStudioAssetSchema, # noqa: E402, F401 +) SageMakerUnifiedStudioAsset.Attributes.update_forward_refs() diff --git a/pyatlan/model/assets/sage_maker_unified_studio_asset_schema.py b/pyatlan/model/assets/sage_maker_unified_studio_asset_schema.py index cc6f06e84..9f44258e6 100644 --- a/pyatlan/model/assets/sage_maker_unified_studio_asset_schema.py +++ b/pyatlan/model/assets/sage_maker_unified_studio_asset_schema.py @@ -124,6 +124,8 @@ class Attributes(SageMakerUnifiedStudio.Attributes): ) -from .sage_maker_unified_studio_asset import SageMakerUnifiedStudioAsset # noqa: E402, F401 +from .sage_maker_unified_studio_asset import ( + SageMakerUnifiedStudioAsset, # noqa: E402, F401 +) SageMakerUnifiedStudioAssetSchema.Attributes.update_forward_refs() diff --git a/pyatlan/model/assets/sage_maker_unified_studio_published_asset.py b/pyatlan/model/assets/sage_maker_unified_studio_published_asset.py index d7f95abcf..aaaf63b96 100644 --- a/pyatlan/model/assets/sage_maker_unified_studio_published_asset.py +++ b/pyatlan/model/assets/sage_maker_unified_studio_published_asset.py @@ -380,7 +380,9 @@ class Attributes(SageMakerUnifiedStudioAsset.Attributes): ) -from .sage_maker_unified_studio_project import SageMakerUnifiedStudioProject # noqa: E402, F401 +from .sage_maker_unified_studio_project import ( + SageMakerUnifiedStudioProject, # noqa: E402, F401 +) from .sage_maker_unified_studio_subscribed_asset import ( SageMakerUnifiedStudioSubscribedAsset, ) # noqa: E402, F401 diff --git a/pyatlan/model/assets/sage_maker_unified_studio_subscribed_asset.py b/pyatlan/model/assets/sage_maker_unified_studio_subscribed_asset.py index 494b0ab9a..f19c9b067 100644 --- a/pyatlan/model/assets/sage_maker_unified_studio_subscribed_asset.py +++ b/pyatlan/model/assets/sage_maker_unified_studio_subscribed_asset.py @@ -541,7 +541,9 @@ class Attributes(SageMakerUnifiedStudioAsset.Attributes): ) -from .sage_maker_unified_studio_project import SageMakerUnifiedStudioProject # noqa: E402, F401 +from .sage_maker_unified_studio_project import ( + SageMakerUnifiedStudioProject, # noqa: E402, F401 +) from .sage_maker_unified_studio_published_asset import ( SageMakerUnifiedStudioPublishedAsset, ) # noqa: E402, F401 diff --git a/pyatlan/model/assets/sap_erp_column.py b/pyatlan/model/assets/sap_erp_column.py index d940f0572..c576bbcb2 100644 --- a/pyatlan/model/assets/sap_erp_column.py +++ b/pyatlan/model/assets/sap_erp_column.py @@ -1539,8 +1539,12 @@ class Attributes(SAP.Attributes): from .core.dbt_seed import DbtSeed # noqa: E402, F401 from .core.dbt_source import DbtSource # noqa: E402, F401 from .core.dbt_test import DbtTest # noqa: E402, F401 -from .core.snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable # noqa: E402, F401 -from .core.sql_insight_business_question import SqlInsightBusinessQuestion # noqa: E402, F401 +from .core.snowflake_semantic_logical_table import ( + SnowflakeSemanticLogicalTable, # noqa: E402, F401 +) +from .core.sql_insight_business_question import ( + SqlInsightBusinessQuestion, # noqa: E402, F401 +) from .core.sql_insight_join import SqlInsightJoin # noqa: E402, F401 from .sap_erp_cds_view import SapErpCdsView # noqa: E402, F401 from .sap_erp_table import SapErpTable # noqa: E402, F401 diff --git a/pyatlan/model/structs.py b/pyatlan/model/structs.py index 1f2a83f41..e9591cd5f 100644 --- a/pyatlan/model/structs.py +++ b/pyatlan/model/structs.py @@ -7,16 +7,17 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Union from pydantic.v1 import BaseModel, Extra, Field, root_validator + from pyatlan.model.enums import ( + AppWorkflowRunStatus, + AssetSmusMetadataFormStatus, AtlanConnectorType, BadgeComparisonOperator, BadgeConditionColor, - SourceCostUnitType, + DataQualityRuleThresholdUnit, FormFieldDimension, FormFieldType, - DataQualityRuleThresholdUnit, - AppWorkflowRunStatus, - AssetSmusMetadataFormStatus, + SourceCostUnitType, ) from pyatlan.model.utils import to_camel_case from pyatlan.utils import select_optional_set_fields, validate_required_fields @@ -24,8 +25,8 @@ if TYPE_CHECKING: from pyatlan.cache.aio.source_tag_cache import AsyncSourceTagName from pyatlan.cache.source_tag_cache import SourceTagName - from pyatlan.client.atlan import AtlanClient from pyatlan.client.aio import AsyncAtlanClient + from pyatlan.client.atlan import AtlanClient class AtlanObject(BaseModel): diff --git a/pyatlan/version.txt b/pyatlan/version.txt index fcfed5b06..f628d2eaf 100644 --- a/pyatlan/version.txt +++ b/pyatlan/version.txt @@ -1 +1 @@ -11.3.0 \ No newline at end of file +11.3.0 diff --git a/pyatlan_v9/model/assets/__init__.py b/pyatlan_v9/model/assets/__init__.py index 53cd6288d..ed6cb1d02 100644 --- a/pyatlan_v9/model/assets/__init__.py +++ b/pyatlan_v9/model/assets/__init__.py @@ -1,1147 +1,106 @@ -# Auto-generated by PythonMsgspecRenderer.pkl — DO NOT EDIT +# Auto-generated by PythonMsgspecRenderer.pkl - DO NOT EDIT # SPDX-License-Identifier: Apache-2.0 # Copyright 2024 Atlan Pte. Ltd. -# isort: skip_file +# +# NOTE: The lazy-loading logic below (_build_lazy_index / __getattr__) is +# intentionally NOT auto-generated — preserve it when regenerating this file. +# It replaces the previous eager _discover_and_export() call which imported +# all ~80 _init_*.py modules at package import time regardless of which types +# were actually needed, causing unnecessary memory usage in apps that only use +# a handful of models. -import lazy_loader as lazy +""" +PyAtlan Models - Auto-generated asset model classes. -from .entity import AtlasClassification, Entity, TermAssignment -from .related_entity import RelatedEntity, SaveSemantic +This module lazily re-exports all types from _init_*.py modules. +New modules are automatically picked up without needing to regenerate this file. -__PYATLAN_V9_ASSETS__ = { - "_init_access_control": [ - "AccessControl", - "AuthPolicy", - "AuthService", - "Persona", - "Purpose", - "RelatedAccessControl", - "RelatedAuthPolicy", - "RelatedAuthService", - "RelatedPersona", - "RelatedPurpose", - ], - "_init_adf": [ - "ADF", - "AdfActivity", - "AdfDataflow", - "AdfDataset", - "AdfLinkedservice", - "AdfPipeline", - "RelatedADF", - "RelatedAdfActivity", - "RelatedAdfDataflow", - "RelatedAdfDataset", - "RelatedAdfLinkedservice", - "RelatedAdfPipeline", - ], - "_init_adls": [ - "ADLS", - "ADLSAccount", - "ADLSContainer", - "ADLSObject", - "RelatedADLS", - "RelatedADLSAccount", - "RelatedADLSContainer", - "RelatedADLSObject", - ], - "_init_agent": ["Agent", "RelatedAgent"], - "_init_agentic": ["Agentic", "RelatedAgentic"], - "_init_ai": [ - "AI", - "AIApplication", - "AIModel", - "AIModelVersion", - "RelatedAI", - "RelatedAIApplication", - "RelatedAIModel", - "RelatedAIModelVersion", - ], - "_init_airflow": [ - "Airflow", - "AirflowDag", - "AirflowTask", - "RelatedAirflow", - "RelatedAirflowDag", - "RelatedAirflowTask", - ], - "_init_anaplan": [ - "Anaplan", - "AnaplanApp", - "AnaplanDimension", - "AnaplanLineItem", - "AnaplanList", - "AnaplanModel", - "AnaplanModule", - "AnaplanPage", - "AnaplanSystemDimension", - "AnaplanView", - "AnaplanWorkspace", - "RelatedAnaplan", - "RelatedAnaplanApp", - "RelatedAnaplanDimension", - "RelatedAnaplanLineItem", - "RelatedAnaplanList", - "RelatedAnaplanModel", - "RelatedAnaplanModule", - "RelatedAnaplanPage", - "RelatedAnaplanSystemDimension", - "RelatedAnaplanView", - "RelatedAnaplanWorkspace", - ], - "_init_anomalo": [ - "Anomalo", - "AnomaloCheck", - "RelatedAnomalo", - "RelatedAnomaloCheck", - ], - "_init_api": [ - "API", - "APIField", - "APIObject", - "APIPath", - "APIQuery", - "APISpec", - "RelatedAPI", - "RelatedAPIField", - "RelatedAPIObject", - "RelatedAPIPath", - "RelatedAPIQuery", - "RelatedAPISpec", - ], - "_init_app": [ - "App", - "Application", - "ApplicationField", - "RelatedApp", - "RelatedApplication", - "RelatedApplicationField", - ], - "_init_app_workflow_run": ["AppWorkflowRun", "RelatedAppWorkflowRun"], - "_init_artifact": ["Artifact", "RelatedArtifact"], - "_init_asset": [ - "Asset", - "DataSet", - "Incident", - "Infrastructure", - "ProcessExecution", - "RelatedAsset", - "RelatedDataSet", - "RelatedIncident", - "RelatedInfrastructure", - "RelatedProcessExecution", - ], - "_init_asset_grouping": [ - "AssetGrouping", - "AssetGroupingCollection", - "AssetGroupingStrategy", - "RelatedAssetGrouping", - "RelatedAssetGroupingCollection", - "RelatedAssetGroupingStrategy", - ], - "_init_atlan_app": [ - "AtlanApp", - "AtlanAppDeployment", - "AtlanAppInstalled", - "AtlanAppTool", - "AtlanAppWorkflow", - "RelatedAtlanApp", - "RelatedAtlanAppDeployment", - "RelatedAtlanAppInstalled", - "RelatedAtlanAppTool", - "RelatedAtlanAppWorkflow", - ], - "_init_azure_service_bus": [ - "AzureServiceBus", - "AzureServiceBusNamespace", - "AzureServiceBusSchema", - "AzureServiceBusTopic", - "RelatedAzureServiceBus", - "RelatedAzureServiceBusNamespace", - "RelatedAzureServiceBusSchema", - "RelatedAzureServiceBusTopic", - ], - "_init_bigquery": [ - "BigqueryRoutine", - "RelatedBigqueryRoutine", - "RelatedBigqueryTag", - ], - "_init_business_policy": [ - "BusinessPolicy", - "RelatedBusinessPolicy", - "RelatedBusinessPolicyException", - "RelatedBusinessPolicyIncident", - "RelatedBusinessPolicyLog", - ], - "_init_cassandra": [ - "Cassandra", - "CassandraColumn", - "CassandraIndex", - "CassandraKeyspace", - "CassandraTable", - "CassandraView", - "RelatedCassandra", - "RelatedCassandraColumn", - "RelatedCassandraIndex", - "RelatedCassandraKeyspace", - "RelatedCassandraTable", - "RelatedCassandraView", - ], - "_init_catalog": [ - "BI", - "Catalog", - "EventStore", - "Insight", - "NoSQL", - "ObjectStore", - "RelatedBI", - "RelatedCatalog", - "RelatedEventStore", - "RelatedInsight", - "RelatedNoSQL", - "RelatedObjectStore", - "RelatedSaaS", - "SaaS", - ], - "_init_cloud": [ - "AWS", - "Azure", - "Cloud", - "Google", - "RelatedAWS", - "RelatedAzure", - "RelatedCloud", - "RelatedGoogle", - ], - "_init_cognite": [ - "Cognite", - "Cognite3DModel", - "CogniteAsset", - "CogniteEvent", - "CogniteFile", - "CogniteSequence", - "CogniteTimeSeries", - "RelatedCognite", - "RelatedCognite3DModel", - "RelatedCogniteAsset", - "RelatedCogniteEvent", - "RelatedCogniteFile", - "RelatedCogniteSequence", - "RelatedCogniteTimeSeries", - ], - "_init_cognos": [ - "Cognos", - "CognosColumn", - "CognosDashboard", - "CognosDataset", - "CognosDatasource", - "CognosExploration", - "CognosFile", - "CognosFolder", - "CognosModule", - "CognosPackage", - "CognosReport", - "RelatedCognos", - "RelatedCognosColumn", - "RelatedCognosDashboard", - "RelatedCognosDataset", - "RelatedCognosDatasource", - "RelatedCognosExploration", - "RelatedCognosFile", - "RelatedCognosFolder", - "RelatedCognosModule", - "RelatedCognosPackage", - "RelatedCognosReport", - ], - "_init_connection": ["Connection", "RelatedConnection"], - "_init_context": [ - "Context", - "ContextArtifact", - "ContextRepository", - "RelatedContext", - "RelatedContextArtifact", - "RelatedContextRepository", - ], - "_init_cosmos_mongo_db": [ - "CosmosMongoDB", - "CosmosMongoDBAccount", - "CosmosMongoDBCollection", - "CosmosMongoDBDatabase", - "RelatedCosmosMongoDB", - "RelatedCosmosMongoDBAccount", - "RelatedCosmosMongoDBCollection", - "RelatedCosmosMongoDBDatabase", - ], - "_init_cube": [ - "Cube", - "CubeDimension", - "CubeField", - "CubeHierarchy", - "MultiDimensionalDataset", - "RelatedCube", - "RelatedCubeDimension", - "RelatedCubeField", - "RelatedCubeHierarchy", - "RelatedMultiDimensionalDataset", - ], - "_init_custom": [ - "Custom", - "CustomEntity", - "RelatedCustom", - "RelatedCustomEntity", - ], - "_init_data_contract": ["DataContract", "RelatedDataContract"], - "_init_data_mesh": [ - "DataDomain", - "DataMesh", - "DataMeshDataset", - "DataProduct", - "RelatedDataDomain", - "RelatedDataMesh", - "RelatedDataMeshDataset", - "RelatedDataProduct", - "RelatedStakeholder", - "RelatedStakeholderTitle", - ], - "_init_data_quality": [ - "DataQuality", - "DataQualityRule", - "DataQualityRuleTemplate", - "Metric", - "RelatedDataQuality", - "RelatedDataQualityRule", - "RelatedDataQualityRuleTemplate", - "RelatedMetric", - ], - "_init_data_studio": [ - "DataStudio", - "DataStudioAsset", - "RelatedDataStudio", - "RelatedDataStudioAsset", - ], - "_init_databricks": [ - "Databricks", - "DatabricksAIModelContext", - "DatabricksAIModelVersion", - "DatabricksDashboard", - "DatabricksExternalLocation", - "DatabricksExternalLocationPath", - "DatabricksGenieAgent", - "DatabricksMetricView", - "DatabricksNotebook", - "DatabricksVolume", - "DatabricksVolumePath", - "RelatedDatabricks", - "RelatedDatabricksAIModelContext", - "RelatedDatabricksAIModelVersion", - "RelatedDatabricksDashboard", - "RelatedDatabricksExternalLocation", - "RelatedDatabricksExternalLocationPath", - "RelatedDatabricksGenieAgent", - "RelatedDatabricksMetricView", - "RelatedDatabricksNotebook", - "RelatedDatabricksUnityCatalogTag", - "RelatedDatabricksVolume", - "RelatedDatabricksVolumePath", - ], - "_init_dataverse": [ - "Dataverse", - "DataverseAttribute", - "DataverseEntity", - "RelatedDataverse", - "RelatedDataverseAttribute", - "RelatedDataverseEntity", - ], - "_init_dbt": [ - "Dbt", - "DbtColumnProcess", - "DbtDimension", - "DbtEntity", - "DbtMeasure", - "DbtMetric", - "DbtModel", - "DbtModelColumn", - "DbtProcess", - "DbtSeed", - "DbtSemanticModel", - "DbtSource", - "DbtTag", - "DbtTest", - "RelatedDbt", - "RelatedDbtColumnProcess", - "RelatedDbtDimension", - "RelatedDbtEntity", - "RelatedDbtMeasure", - "RelatedDbtMetric", - "RelatedDbtModel", - "RelatedDbtModelColumn", - "RelatedDbtProcess", - "RelatedDbtSeed", - "RelatedDbtSemanticModel", - "RelatedDbtSource", - "RelatedDbtTag", - "RelatedDbtTest", - ], - "_init_document_db": [ - "DocumentDB", - "DocumentDBCollection", - "DocumentDBDatabase", - "RelatedDocumentDB", - "RelatedDocumentDBCollection", - "RelatedDocumentDBDatabase", - ], - "_init_domo": [ - "Domo", - "DomoCard", - "DomoDashboard", - "DomoDataset", - "DomoDatasetColumn", - "RelatedDomo", - "RelatedDomoCard", - "RelatedDomoDashboard", - "RelatedDomoDataset", - "RelatedDomoDatasetColumn", - ], - "_init_dremio": [ - "Dremio", - "DremioColumn", - "DremioFolder", - "DremioPhysicalDataset", - "DremioSource", - "DremioSpace", - "DremioVirtualDataset", - "RelatedDremio", - "RelatedDremioColumn", - "RelatedDremioFolder", - "RelatedDremioPhysicalDataset", - "RelatedDremioSource", - "RelatedDremioSpace", - "RelatedDremioVirtualDataset", - ], - "_init_dynamo_db": [ - "DynamoDB", - "DynamoDBAttribute", - "DynamoDBSecondaryIndex", - "DynamoDBTable", - "RelatedDynamoDB", - "RelatedDynamoDBAttribute", - "RelatedDynamoDBGlobalSecondaryIndex", - "RelatedDynamoDBLocalSecondaryIndex", - "RelatedDynamoDBSecondaryIndex", - "RelatedDynamoDBTable", - ], - "_init_fabric": [ - "Fabric", - "FabricActivity", - "FabricDashboard", - "FabricDataPipeline", - "FabricDataflow", - "FabricDataflowEntityColumn", - "FabricPage", - "FabricReport", - "FabricSemanticModel", - "FabricSemanticModelTable", - "FabricSemanticModelTableColumn", - "FabricVisual", - "FabricWorkspace", - "RelatedFabric", - "RelatedFabricActivity", - "RelatedFabricDashboard", - "RelatedFabricDataPipeline", - "RelatedFabricDataflow", - "RelatedFabricDataflowEntityColumn", - "RelatedFabricPage", - "RelatedFabricReport", - "RelatedFabricSemanticModel", - "RelatedFabricSemanticModelTable", - "RelatedFabricSemanticModelTableColumn", - "RelatedFabricVisual", - "RelatedFabricWorkspace", - ], - "_init_fivetran": [ - "Fivetran", - "FivetranConnector", - "RelatedFivetran", - "RelatedFivetranConnector", - ], - "_init_flow": [ - "Flow", - "FlowControlOperation", - "FlowDataset", - "FlowDatasetOperation", - "FlowField", - "FlowFieldOperation", - "FlowFolder", - "FlowProject", - "FlowReusableUnit", - "RelatedFlow", - "RelatedFlowControlOperation", - "RelatedFlowDataset", - "RelatedFlowDatasetOperation", - "RelatedFlowField", - "RelatedFlowFieldOperation", - "RelatedFlowFolder", - "RelatedFlowProject", - "RelatedFlowReusableUnit", - ], - "_init_form": ["Form", "RelatedForm", "RelatedResponse"], - "_init_gcp_dataplex": [ - "GCPDataplex", - "GCPDataplexAspectType", - "RelatedGCPDataplex", - "RelatedGCPDataplexAspectType", - ], - "_init_gcs": [ - "GCS", - "GCSBucket", - "GCSObject", - "RelatedGCS", - "RelatedGCSBucket", - "RelatedGCSObject", - ], - "_init_gtc": [ - "AtlasGlossary", - "AtlasGlossaryCategory", - "AtlasGlossaryTerm", - "RelatedAtlasGlossary", - "RelatedAtlasGlossaryCategory", - "RelatedAtlasGlossaryTerm", - ], - "_init_iceberg": [ - "Iceberg", - "IcebergCatalog", - "IcebergColumn", - "IcebergNamespace", - "IcebergTable", - "RelatedIceberg", - "RelatedIcebergCatalog", - "RelatedIcebergColumn", - "RelatedIcebergNamespace", - "RelatedIcebergTable", - ], - "_init_kafka": [ - "Kafka", - "KafkaCluster", - "KafkaConsumerGroup", - "KafkaField", - "KafkaTopic", - "RelatedAzureEventHub", - "RelatedAzureEventHubConsumerGroup", - "RelatedKafka", - "RelatedKafkaCluster", - "RelatedKafkaConsumerGroup", - "RelatedKafkaField", - "RelatedKafkaTopic", - ], - "_init_knowledge": [ - "Knowledge", - "KnowledgeFile", - "KnowledgeFolder", - "RelatedKnowledge", - "RelatedKnowledgeFile", - "RelatedKnowledgeFolder", - ], - "_init_looker": [ - "Looker", - "LookerDashboard", - "LookerExplore", - "LookerField", - "LookerFolder", - "LookerLook", - "LookerModel", - "LookerProject", - "LookerQuery", - "LookerTile", - "LookerView", - "RelatedLooker", - "RelatedLookerDashboard", - "RelatedLookerExplore", - "RelatedLookerField", - "RelatedLookerFolder", - "RelatedLookerLook", - "RelatedLookerModel", - "RelatedLookerProject", - "RelatedLookerQuery", - "RelatedLookerTile", - "RelatedLookerView", - ], - "_init_manual": [ - "AzureEventHub", - "AzureEventHubConsumerGroup", - "Badge", - "BadgeCondition", - "SnowflakeDynamicTable", - ], - "_init_matillion": [ - "Matillion", - "MatillionComponent", - "MatillionGroup", - "MatillionJob", - "MatillionProject", - "RelatedMatillion", - "RelatedMatillionComponent", - "RelatedMatillionGroup", - "RelatedMatillionJob", - "RelatedMatillionProject", - ], - "_init_metabase": [ - "Metabase", - "MetabaseCollection", - "MetabaseDashboard", - "MetabaseQuestion", - "RelatedMetabase", - "RelatedMetabaseCollection", - "RelatedMetabaseDashboard", - "RelatedMetabaseQuestion", - ], - "_init_micro_strategy": [ - "MicroStrategy", - "MicroStrategyAttribute", - "MicroStrategyColumn", - "MicroStrategyCube", - "MicroStrategyDocument", - "MicroStrategyDossier", - "MicroStrategyFact", - "MicroStrategyMetric", - "MicroStrategyProject", - "MicroStrategyReport", - "MicroStrategyVisualization", - "RelatedMicroStrategy", - "RelatedMicroStrategyAttribute", - "RelatedMicroStrategyColumn", - "RelatedMicroStrategyCube", - "RelatedMicroStrategyDocument", - "RelatedMicroStrategyDossier", - "RelatedMicroStrategyFact", - "RelatedMicroStrategyMetric", - "RelatedMicroStrategyProject", - "RelatedMicroStrategyReport", - "RelatedMicroStrategyVisualization", - ], - "_init_mode": [ - "Mode", - "ModeChart", - "ModeCollection", - "ModeQuery", - "ModeReport", - "ModeWorkspace", - "RelatedMode", - "RelatedModeChart", - "RelatedModeCollection", - "RelatedModeQuery", - "RelatedModeReport", - "RelatedModeWorkspace", - ], - "_init_model": [ - "Model", - "ModelAttribute", - "ModelAttributeAssociation", - "ModelDataModel", - "ModelEntity", - "ModelEntityAssociation", - "ModelVersion", - "RelatedModel", - "RelatedModelAttribute", - "RelatedModelAttributeAssociation", - "RelatedModelDataModel", - "RelatedModelEntity", - "RelatedModelEntityAssociation", - "RelatedModelVersion", - ], - "_init_mongo_db": [ - "MongoDB", - "MongoDBCollection", - "MongoDBDatabase", - "RelatedMongoDB", - "RelatedMongoDBCollection", - "RelatedMongoDBDatabase", - ], - "_init_monte_carlo": [ - "MCIncident", - "MCMonitor", - "MonteCarlo", - "RelatedMCIncident", - "RelatedMCMonitor", - "RelatedMonteCarlo", - ], - "_init_namespace": [ - "Collection", - "Folder", - "Namespace", - "RelatedCollection", - "RelatedFolder", - "RelatedNamespace", - ], - "_init_notebook": ["Notebook", "RelatedNotebook"], - "_init_partial": [ - "Partial", - "PartialField", - "PartialObject", - "RelatedPartial", - "RelatedPartialField", - "RelatedPartialObject", - ], - "_init_power_bi": [ - "PowerBI", - "PowerBIApp", - "PowerBIColumn", - "PowerBIDashboard", - "PowerBIDataflow", - "PowerBIDataflowEntityColumn", - "PowerBIDataset", - "PowerBIDatasource", - "PowerBIMeasure", - "PowerBIPage", - "PowerBIReport", - "PowerBITable", - "PowerBITile", - "PowerBIWorkspace", - "RelatedPowerBI", - "RelatedPowerBIApp", - "RelatedPowerBIColumn", - "RelatedPowerBIDashboard", - "RelatedPowerBIDataflow", - "RelatedPowerBIDataflowEntityColumn", - "RelatedPowerBIDataset", - "RelatedPowerBIDatasource", - "RelatedPowerBIMeasure", - "RelatedPowerBIPage", - "RelatedPowerBIReport", - "RelatedPowerBITable", - "RelatedPowerBITile", - "RelatedPowerBIWorkspace", - ], - "_init_preset": [ - "Preset", - "PresetChart", - "PresetDashboard", - "PresetDataset", - "PresetWorkspace", - "RelatedPreset", - "RelatedPresetChart", - "RelatedPresetDashboard", - "RelatedPresetDataset", - "RelatedPresetWorkspace", - ], - "_init_process": [ - "BIProcess", - "ColumnProcess", - "Process", - "RelatedBIProcess", - "RelatedColumnProcess", - "RelatedConnectionProcess", - "RelatedProcess", - ], - "_init_qlik": [ - "Qlik", - "QlikApp", - "QlikChart", - "QlikColumn", - "QlikDataset", - "QlikSheet", - "QlikSpace", - "RelatedQlik", - "RelatedQlikApp", - "RelatedQlikChart", - "RelatedQlikColumn", - "RelatedQlikDataset", - "RelatedQlikSheet", - "RelatedQlikSpace", - "RelatedQlikStream", - ], - "_init_quick_sight": [ - "QuickSight", - "QuickSightAnalysis", - "QuickSightAnalysisVisual", - "QuickSightDashboard", - "QuickSightDashboardVisual", - "QuickSightDataset", - "QuickSightDatasetField", - "QuickSightFolder", - "RelatedQuickSight", - "RelatedQuickSightAnalysis", - "RelatedQuickSightAnalysisVisual", - "RelatedQuickSightDashboard", - "RelatedQuickSightDashboardVisual", - "RelatedQuickSightDataset", - "RelatedQuickSightDatasetField", - "RelatedQuickSightFolder", - ], - "_init_redash": [ - "Redash", - "RedashDashboard", - "RedashQuery", - "RedashVisualization", - "RelatedRedash", - "RelatedRedashDashboard", - "RelatedRedashQuery", - "RelatedRedashVisualization", - ], - "_init_referenceable": ["Referenceable", "RelatedReferenceable"], - "_init_resource": [ - "File", - "Link", - "Readme", - "ReadmeTemplate", - "RelatedBadge", - "RelatedFile", - "RelatedLink", - "RelatedReadme", - "RelatedReadmeTemplate", - "RelatedResource", - "Related__internal", - "Resource", - ], - "_init_s3": [ - "RelatedS3", - "RelatedS3Bucket", - "RelatedS3Object", - "RelatedS3Prefix", - "S3", - "S3Bucket", - "S3Object", - "S3Prefix", - ], - "_init_sage_maker": [ - "RelatedSageMaker", - "RelatedSageMakerFeature", - "RelatedSageMakerFeatureGroup", - "RelatedSageMakerModel", - "RelatedSageMakerModelDeployment", - "RelatedSageMakerModelGroup", - "SageMaker", - "SageMakerFeature", - "SageMakerFeatureGroup", - "SageMakerModel", - "SageMakerModelDeployment", - "SageMakerModelGroup", - ], - "_init_sage_maker_unified_studio": [ - "RelatedSageMakerUnifiedStudio", - "RelatedSageMakerUnifiedStudioAsset", - "RelatedSageMakerUnifiedStudioAssetSchema", - "RelatedSageMakerUnifiedStudioProject", - "RelatedSageMakerUnifiedStudioPublishedAsset", - "RelatedSageMakerUnifiedStudioSubscribedAsset", - "SageMakerUnifiedStudio", - "SageMakerUnifiedStudioAsset", - "SageMakerUnifiedStudioAssetSchema", - "SageMakerUnifiedStudioProject", - "SageMakerUnifiedStudioPublishedAsset", - "SageMakerUnifiedStudioSubscribedAsset", - ], - "_init_salesforce": [ - "RelatedSalesforce", - "RelatedSalesforceDashboard", - "RelatedSalesforceField", - "RelatedSalesforceObject", - "RelatedSalesforceOrganization", - "RelatedSalesforceReport", - "Salesforce", - "SalesforceDashboard", - "SalesforceField", - "SalesforceObject", - "SalesforceOrganization", - "SalesforceReport", - ], - "_init_sap": [ - "RelatedSAP", - "RelatedSAPColumnProcess", - "RelatedSAPProcess", - "RelatedSapDatasphereReplicationFlow", - "RelatedSapErpAbapProgram", - "RelatedSapErpCdsView", - "RelatedSapErpColumn", - "RelatedSapErpComponent", - "RelatedSapErpFioriApp", - "RelatedSapErpFunctionModule", - "RelatedSapErpTable", - "RelatedSapErpTransactionCode", - "RelatedSapErpView", - "SAP", - "SAPColumnProcess", - "SAPProcess", - "SapDatasphereReplicationFlow", - "SapErpAbapProgram", - "SapErpCdsView", - "SapErpColumn", - "SapErpComponent", - "SapErpFioriApp", - "SapErpFunctionModule", - "SapErpTable", - "SapErpTransactionCode", - "SapErpView", - ], - "_init_sapbw": [ - "RelatedSAPBW", - "RelatedSAPBWADSO", - "RelatedSAPBWADSOField", - "RelatedSAPBWCompositeProvider", - "RelatedSAPBWCompositeProviderField", - "RelatedSAPBWDTP", - "RelatedSAPBWDataSource", - "RelatedSAPBWDataSourceField", - "RelatedSAPBWInfoArea", - "RelatedSAPBWInfoObject", - "RelatedSAPBWInfoSource", - "RelatedSAPBWInfoSourceField", - "RelatedSAPBWQuery", - "RelatedSAPBWQueryElement", - "RelatedSAPBWTransformation", - "SAPBW", - "SAPBWADSO", - "SAPBWADSOField", - "SAPBWCompositeProvider", - "SAPBWCompositeProviderField", - "SAPBWDTP", - "SAPBWDataSource", - "SAPBWDataSourceField", - "SAPBWInfoArea", - "SAPBWInfoObject", - "SAPBWInfoSource", - "SAPBWInfoSourceField", - "SAPBWQuery", - "SAPBWQueryElement", - "SAPBWTransformation", - ], - "_init_schema_registry": [ - "RelatedSchemaRegistry", - "RelatedSchemaRegistrySubject", - "RelatedSchemaRegistryVersion", - "SchemaRegistry", - "SchemaRegistrySubject", - "SchemaRegistryVersion", - ], - "_init_semantic": [ - "RelatedSemantic", - "RelatedSemanticDimension", - "RelatedSemanticEntity", - "RelatedSemanticField", - "RelatedSemanticMeasure", - "RelatedSemanticModel", - "Semantic", - "SemanticDimension", - "SemanticEntity", - "SemanticField", - "SemanticMeasure", - "SemanticModel", - ], - "_init_sigma": [ - "RelatedSigma", - "RelatedSigmaDataElement", - "RelatedSigmaDataElementField", - "RelatedSigmaDataModel", - "RelatedSigmaDataModelColumn", - "RelatedSigmaDataset", - "RelatedSigmaDatasetColumn", - "RelatedSigmaPage", - "RelatedSigmaWorkbook", - "Sigma", - "SigmaDataElement", - "SigmaDataElementField", - "SigmaDataModel", - "SigmaDataModelColumn", - "SigmaDataset", - "SigmaDatasetColumn", - "SigmaPage", - "SigmaWorkbook", - ], - "_init_sisense": [ - "RelatedSisense", - "RelatedSisenseDashboard", - "RelatedSisenseDatamodel", - "RelatedSisenseDatamodelTable", - "RelatedSisenseFolder", - "RelatedSisenseWidget", - "Sisense", - "SisenseDashboard", - "SisenseDatamodel", - "SisenseDatamodelTable", - "SisenseFolder", - "SisenseWidget", - ], - "_init_skill": ["RelatedSkill", "Skill"], - "_init_skill_artifact": ["RelatedSkillArtifact", "SkillArtifact"], - "_init_snowflake": [ - "RelatedSnowflake", - "RelatedSnowflakeAIModelContext", - "RelatedSnowflakeAIModelVersion", - "RelatedSnowflakeDynamicTable", - "RelatedSnowflakeListing", - "RelatedSnowflakePipe", - "RelatedSnowflakeSemanticDimension", - "RelatedSnowflakeSemanticFact", - "RelatedSnowflakeSemanticLogicalTable", - "RelatedSnowflakeSemanticMetric", - "RelatedSnowflakeSemanticView", - "RelatedSnowflakeShare", - "RelatedSnowflakeStage", - "RelatedSnowflakeStream", - "RelatedSnowflakeTag", - "Snowflake", - "SnowflakeAIModelContext", - "SnowflakeAIModelVersion", - "SnowflakeListing", - "SnowflakeSemanticDimension", - "SnowflakeSemanticFact", - "SnowflakeSemanticLogicalTable", - "SnowflakeSemanticMetric", - "SnowflakeSemanticView", - "SnowflakeShare", - ], - "_init_soda": [ - "RelatedSoda", - "RelatedSodaCheck", - "Soda", - "SodaCheck", - ], - "_init_spark": [ - "RelatedSpark", - "RelatedSparkJob", - "Spark", - "SparkJob", - ], - "_init_sql": [ - "CalculationView", - "Column", - "Database", - "Function", - "MaterialisedView", - "Procedure", - "Query", - "RelatedCalculationView", - "RelatedColumn", - "RelatedDatabase", - "RelatedFunction", - "RelatedMaterialisedView", - "RelatedProcedure", - "RelatedQuery", - "RelatedSQL", - "RelatedSchema", - "RelatedTable", - "RelatedTablePartition", - "RelatedView", - "SQL", - "Schema", - "Table", - "TablePartition", - "View", - ], - "_init_sql_insight": [ - "RelatedSqlInsight", - "RelatedSqlInsightBusinessQuestion", - "RelatedSqlInsightFilter", - "RelatedSqlInsightJoin", - "SqlInsight", - "SqlInsightBusinessQuestion", - "SqlInsightFilter", - "SqlInsightJoin", - ], - "_init_ssrs": [ - "RelatedSSRS", - "RelatedSSRSDataSet", - "RelatedSSRSField", - "RelatedSSRSFolder", - "RelatedSSRSReport", - "SSRS", - "SSRSDataSet", - "SSRSField", - "SSRSFolder", - "SSRSReport", - ], - "_init_starburst": [ - "RelatedStarburst", - "RelatedStarburstDataset", - "RelatedStarburstDatasetColumn", - "Starburst", - "StarburstDataset", - "StarburstDatasetColumn", - ], - "_init_superset": [ - "RelatedSuperset", - "RelatedSupersetChart", - "RelatedSupersetDashboard", - "RelatedSupersetDataset", - "Superset", - "SupersetChart", - "SupersetDashboard", - "SupersetDataset", - ], - "_init_tableau": [ - "RelatedTableau", - "RelatedTableauCalculatedField", - "RelatedTableauDashboard", - "RelatedTableauDashboardField", - "RelatedTableauDatasource", - "RelatedTableauDatasourceField", - "RelatedTableauFlow", - "RelatedTableauMetric", - "RelatedTableauProject", - "RelatedTableauSite", - "RelatedTableauWorkbook", - "RelatedTableauWorksheet", - "RelatedTableauWorksheetField", - "Tableau", - "TableauCalculatedField", - "TableauDashboard", - "TableauDashboardField", - "TableauDatasource", - "TableauDatasourceField", - "TableauFlow", - "TableauMetric", - "TableauProject", - "TableauSite", - "TableauWorkbook", - "TableauWorksheet", - "TableauWorksheetField", - ], - "_init_tag": [ - "RelatedSourceTag", - "RelatedTag", - "RelatedTagAttachment", - "SourceTag", - "Tag", - ], - "_init_task": ["RelatedTask", "Task"], - "_init_thoughtspot": [ - "RelatedThoughtspot", - "RelatedThoughtspotAnswer", - "RelatedThoughtspotColumn", - "RelatedThoughtspotDashlet", - "RelatedThoughtspotLiveboard", - "RelatedThoughtspotTable", - "RelatedThoughtspotView", - "RelatedThoughtspotWorksheet", - "Thoughtspot", - "ThoughtspotAnswer", - "ThoughtspotColumn", - "ThoughtspotDashlet", - "ThoughtspotLiveboard", - "ThoughtspotTable", - "ThoughtspotView", - "ThoughtspotWorksheet", - ], - "_init_unstructured": [ - "RelatedUnstructured", - "RelatedUnstructuredContainer", - "RelatedUnstructuredFolder", - "RelatedUnstructuredObject", - "Unstructured", - "UnstructuredContainer", - "UnstructuredFolder", - "UnstructuredObject", - ], - "_init_workflow": ["RelatedWorkflow", "RelatedWorkflowRun", "Workflow"], -} +Direct submodule imports are preferred and have zero overhead at import time:: -__getattr__, __dir__, __all__ = lazy.attach( - __name__, submod_attrs=__PYATLAN_V9_ASSETS__ -) + from pyatlan.models.column import Column # preferred — zero overhead -__all__ += [ - "AtlasClassification", +Package-level imports also work and only load the specific module needed:: + + from pyatlan.models import Column # lazy — only _init_sql.py loaded +""" + +from __future__ import annotations + +import ast +import importlib +import pkgutil +from pathlib import Path +from typing import Any + +# Base classes are always exported eagerly (they have no large transitive deps). +from .entity import AtlasClassification, Entity, TermAssignment +from .related_entity import RelatedEntity, SaveSemantic + +__all__ = [ + # Base classes "Entity", + "AtlasClassification", "TermAssignment", "RelatedEntity", "SaveSemantic", ] + +# Lazy index: class name → _init_module_name. +# Built once on first __getattr__ call via AST scanning (no module execution). +_lazy_index: dict[str, str] | None = None + + +def _build_lazy_index() -> dict[str, str]: + """Scan _init_*.py __all__ lists via AST to build a name→module map. + + Uses ast.parse() so no model modules are executed or imported — only their + source text is read to extract the __all__ list. + """ + index: dict[str, str] = {} + current_dir = Path(__file__).parent + for module_info in pkgutil.iter_modules([str(current_dir)]): + if not module_info.name.startswith("_init_"): + continue + module_file = current_dir / f"{module_info.name}.py" + try: + tree = ast.parse(module_file.read_bytes()) + except SyntaxError: + continue + for node in ast.walk(tree): + if isinstance(node, ast.Assign): + for target in node.targets: + if isinstance(target, ast.Name) and target.id == "__all__": + if isinstance(node.value, (ast.List, ast.Tuple)): + for elt in node.value.elts: + if isinstance(elt, ast.Constant) and isinstance( + elt.value, str + ): + index[elt.value] = module_info.name + return index + + +def __getattr__(name: str) -> Any: + """Lazy import of model classes on first access. + + Called by Python when an attribute is not found in this module's globals. + Enables ``from pyatlan.models import Column`` without eagerly importing all + model modules at package import time. + + The result is cached in globals() so subsequent accesses are O(1) dict lookups + and never go through __getattr__ again. + """ + global _lazy_index + if _lazy_index is None: + _lazy_index = _build_lazy_index() + + module_name = _lazy_index.get(name) + if module_name is not None: + module = importlib.import_module(f".{module_name}", __package__) + val = getattr(module, name) + # Cache in globals so future accesses bypass __getattr__ entirely. + globals()[name] = val + if name not in __all__: + __all__.append(name) + return val + + raise AttributeError(f"module 'pyatlan.models' has no attribute {name!r}") diff --git a/pyatlan_v9/model/assets/_init_access_control.py b/pyatlan_v9/model/assets/_init_access_control.py index e50f60655..ca7c8a1fa 100644 --- a/pyatlan_v9/model/assets/_init_access_control.py +++ b/pyatlan_v9/model/assets/_init_access_control.py @@ -8,6 +8,7 @@ This module provides convenient imports for all AccessControl types and their Related variants. """ +from .access_control import AccessControl from .access_control_related import ( RelatedAccessControl, RelatedAuthPolicy, @@ -15,7 +16,6 @@ RelatedPersona, RelatedPurpose, ) -from .access_control import AccessControl from .auth_policy import AuthPolicy from .auth_service import AuthService from .persona import Persona diff --git a/pyatlan_v9/model/assets/_init_adf.py b/pyatlan_v9/model/assets/_init_adf.py index 5c407d66c..2d2d0725f 100644 --- a/pyatlan_v9/model/assets/_init_adf.py +++ b/pyatlan_v9/model/assets/_init_adf.py @@ -8,6 +8,12 @@ This module provides convenient imports for all ADF types and their Related variants. """ +from .adf import ADF +from .adf_activity import AdfActivity +from .adf_dataflow import AdfDataflow +from .adf_dataset import AdfDataset +from .adf_linkedservice import AdfLinkedservice +from .adf_pipeline import AdfPipeline from .adf_related import ( RelatedADF, RelatedAdfActivity, @@ -16,12 +22,6 @@ RelatedAdfLinkedservice, RelatedAdfPipeline, ) -from .adf import ADF -from .adf_activity import AdfActivity -from .adf_dataflow import AdfDataflow -from .adf_dataset import AdfDataset -from .adf_linkedservice import AdfLinkedservice -from .adf_pipeline import AdfPipeline __all__ = [ "ADF", diff --git a/pyatlan_v9/model/assets/_init_adls.py b/pyatlan_v9/model/assets/_init_adls.py index 5b2547812..aa10dd6de 100644 --- a/pyatlan_v9/model/assets/_init_adls.py +++ b/pyatlan_v9/model/assets/_init_adls.py @@ -8,16 +8,16 @@ This module provides convenient imports for all ADLS types and their Related variants. """ +from .adls import ADLS +from .adls_account import ADLSAccount +from .adls_container import ADLSContainer +from .adls_object import ADLSObject from .adls_related import ( RelatedADLS, RelatedADLSAccount, RelatedADLSContainer, RelatedADLSObject, ) -from .adls import ADLS -from .adls_account import ADLSAccount -from .adls_container import ADLSContainer -from .adls_object import ADLSObject __all__ = [ "ADLS", diff --git a/pyatlan_v9/model/assets/_init_agent.py b/pyatlan_v9/model/assets/_init_agent.py index 4f839aff8..930289cb9 100644 --- a/pyatlan_v9/model/assets/_init_agent.py +++ b/pyatlan_v9/model/assets/_init_agent.py @@ -8,8 +8,8 @@ This module provides convenient imports for all Agent types and their Related variants. """ -from .agent_related import RelatedAgent from .agent import Agent +from .agent_related import RelatedAgent __all__ = [ "Agent", diff --git a/pyatlan_v9/model/assets/_init_agentic.py b/pyatlan_v9/model/assets/_init_agentic.py index 51d75c1d1..f67546b99 100644 --- a/pyatlan_v9/model/assets/_init_agentic.py +++ b/pyatlan_v9/model/assets/_init_agentic.py @@ -8,8 +8,8 @@ This module provides convenient imports for all Agentic types and their Related variants. """ -from .agentic_related import RelatedAgentic from .agentic import Agentic +from .agentic_related import RelatedAgentic __all__ = [ "Agentic", diff --git a/pyatlan_v9/model/assets/_init_ai.py b/pyatlan_v9/model/assets/_init_ai.py index e1faa5415..4a1aadd79 100644 --- a/pyatlan_v9/model/assets/_init_ai.py +++ b/pyatlan_v9/model/assets/_init_ai.py @@ -8,16 +8,16 @@ This module provides convenient imports for all AI types and their Related variants. """ +from .ai import AI +from .ai_application import AIApplication +from .ai_model import AIModel +from .ai_model_version import AIModelVersion from .ai_related import ( RelatedAI, RelatedAIApplication, RelatedAIModel, RelatedAIModelVersion, ) -from .ai import AI -from .ai_application import AIApplication -from .ai_model import AIModel -from .ai_model_version import AIModelVersion __all__ = [ "AI", diff --git a/pyatlan_v9/model/assets/_init_airflow.py b/pyatlan_v9/model/assets/_init_airflow.py index 5d046f8d5..0971ca7e5 100644 --- a/pyatlan_v9/model/assets/_init_airflow.py +++ b/pyatlan_v9/model/assets/_init_airflow.py @@ -8,13 +8,9 @@ This module provides convenient imports for all Airflow types and their Related variants. """ -from .airflow_related import ( - RelatedAirflow, - RelatedAirflowDag, - RelatedAirflowTask, -) from .airflow import Airflow from .airflow_dag import AirflowDag +from .airflow_related import RelatedAirflow, RelatedAirflowDag, RelatedAirflowTask from .airflow_task import AirflowTask __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_anaplan.py b/pyatlan_v9/model/assets/_init_anaplan.py index 1871726ec..53dccc0da 100644 --- a/pyatlan_v9/model/assets/_init_anaplan.py +++ b/pyatlan_v9/model/assets/_init_anaplan.py @@ -8,6 +8,14 @@ This module provides convenient imports for all Anaplan types and their Related variants. """ +from .anaplan import Anaplan +from .anaplan_app import AnaplanApp +from .anaplan_dimension import AnaplanDimension +from .anaplan_line_item import AnaplanLineItem +from .anaplan_list import AnaplanList +from .anaplan_model import AnaplanModel +from .anaplan_module import AnaplanModule +from .anaplan_page import AnaplanPage from .anaplan_related import ( RelatedAnaplan, RelatedAnaplanApp, @@ -21,14 +29,6 @@ RelatedAnaplanView, RelatedAnaplanWorkspace, ) -from .anaplan import Anaplan -from .anaplan_app import AnaplanApp -from .anaplan_dimension import AnaplanDimension -from .anaplan_line_item import AnaplanLineItem -from .anaplan_list import AnaplanList -from .anaplan_model import AnaplanModel -from .anaplan_module import AnaplanModule -from .anaplan_page import AnaplanPage from .anaplan_system_dimension import AnaplanSystemDimension from .anaplan_view import AnaplanView from .anaplan_workspace import AnaplanWorkspace diff --git a/pyatlan_v9/model/assets/_init_anomalo.py b/pyatlan_v9/model/assets/_init_anomalo.py index b462dc927..10a3369cf 100644 --- a/pyatlan_v9/model/assets/_init_anomalo.py +++ b/pyatlan_v9/model/assets/_init_anomalo.py @@ -8,12 +8,9 @@ This module provides convenient imports for all Anomalo types and their Related variants. """ -from .anomalo_related import ( - RelatedAnomalo, - RelatedAnomaloCheck, -) from .anomalo import Anomalo from .anomalo_check import AnomaloCheck +from .anomalo_related import RelatedAnomalo, RelatedAnomaloCheck __all__ = [ "Anomalo", diff --git a/pyatlan_v9/model/assets/_init_api.py b/pyatlan_v9/model/assets/_init_api.py index cca1d78b8..7f63eaf76 100644 --- a/pyatlan_v9/model/assets/_init_api.py +++ b/pyatlan_v9/model/assets/_init_api.py @@ -8,6 +8,11 @@ This module provides convenient imports for all API types and their Related variants. """ +from .api import API +from .api_field import APIField +from .api_object import APIObject +from .api_path import APIPath +from .api_query import APIQuery from .api_related import ( RelatedAPI, RelatedAPIField, @@ -16,11 +21,6 @@ RelatedAPIQuery, RelatedAPISpec, ) -from .api import API -from .api_field import APIField -from .api_object import APIObject -from .api_path import APIPath -from .api_query import APIQuery from .api_spec import APISpec __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_app.py b/pyatlan_v9/model/assets/_init_app.py index 4c26a6910..51a1df09c 100644 --- a/pyatlan_v9/model/assets/_init_app.py +++ b/pyatlan_v9/model/assets/_init_app.py @@ -8,12 +8,8 @@ This module provides convenient imports for all App types and their Related variants. """ -from .app_related import ( - RelatedApp, - RelatedApplication, - RelatedApplicationField, -) from .app import App +from .app_related import RelatedApp, RelatedApplication, RelatedApplicationField from .application import Application from .application_field import ApplicationField diff --git a/pyatlan_v9/model/assets/_init_app_workflow_run.py b/pyatlan_v9/model/assets/_init_app_workflow_run.py index 4c178f2de..3f5e7fa7d 100644 --- a/pyatlan_v9/model/assets/_init_app_workflow_run.py +++ b/pyatlan_v9/model/assets/_init_app_workflow_run.py @@ -8,8 +8,8 @@ This module provides convenient imports for all AppWorkflowRun types and their Related variants. """ -from .app_workflow_run_related import RelatedAppWorkflowRun from .app_workflow_run import AppWorkflowRun +from .app_workflow_run_related import RelatedAppWorkflowRun __all__ = [ "AppWorkflowRun", diff --git a/pyatlan_v9/model/assets/_init_artifact.py b/pyatlan_v9/model/assets/_init_artifact.py index 20528c615..26f2cf80d 100644 --- a/pyatlan_v9/model/assets/_init_artifact.py +++ b/pyatlan_v9/model/assets/_init_artifact.py @@ -8,8 +8,8 @@ This module provides convenient imports for all Artifact types and their Related variants. """ -from .artifact_related import RelatedArtifact from .artifact import Artifact +from .artifact_related import RelatedArtifact __all__ = [ "Artifact", diff --git a/pyatlan_v9/model/assets/_init_asset.py b/pyatlan_v9/model/assets/_init_asset.py index ffb0e1ecd..bb728ee53 100644 --- a/pyatlan_v9/model/assets/_init_asset.py +++ b/pyatlan_v9/model/assets/_init_asset.py @@ -8,6 +8,7 @@ This module provides convenient imports for all Asset types and their Related variants. """ +from .asset import Asset from .asset_related import ( RelatedAsset, RelatedDataSet, @@ -15,7 +16,6 @@ RelatedInfrastructure, RelatedProcessExecution, ) -from .asset import Asset from .data_set import DataSet from .incident import Incident from .infrastructure import Infrastructure diff --git a/pyatlan_v9/model/assets/_init_asset_grouping.py b/pyatlan_v9/model/assets/_init_asset_grouping.py index e175d1263..01e725e58 100644 --- a/pyatlan_v9/model/assets/_init_asset_grouping.py +++ b/pyatlan_v9/model/assets/_init_asset_grouping.py @@ -8,13 +8,13 @@ This module provides convenient imports for all AssetGrouping types and their Related variants. """ +from .asset_grouping import AssetGrouping +from .asset_grouping_collection import AssetGroupingCollection from .asset_grouping_related import ( RelatedAssetGrouping, RelatedAssetGroupingCollection, RelatedAssetGroupingStrategy, ) -from .asset_grouping import AssetGrouping -from .asset_grouping_collection import AssetGroupingCollection from .asset_grouping_strategy import AssetGroupingStrategy __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_atlan_app.py b/pyatlan_v9/model/assets/_init_atlan_app.py index ed558ee8d..ee30de436 100644 --- a/pyatlan_v9/model/assets/_init_atlan_app.py +++ b/pyatlan_v9/model/assets/_init_atlan_app.py @@ -8,6 +8,9 @@ This module provides convenient imports for all AtlanApp types and their Related variants. """ +from .atlan_app import AtlanApp +from .atlan_app_deployment import AtlanAppDeployment +from .atlan_app_installed import AtlanAppInstalled from .atlan_app_related import ( RelatedAtlanApp, RelatedAtlanAppDeployment, @@ -15,9 +18,6 @@ RelatedAtlanAppTool, RelatedAtlanAppWorkflow, ) -from .atlan_app import AtlanApp -from .atlan_app_deployment import AtlanAppDeployment -from .atlan_app_installed import AtlanAppInstalled from .atlan_app_tool import AtlanAppTool from .atlan_app_workflow import AtlanAppWorkflow diff --git a/pyatlan_v9/model/assets/_init_azure_service_bus.py b/pyatlan_v9/model/assets/_init_azure_service_bus.py index f2298f636..34d4aa301 100644 --- a/pyatlan_v9/model/assets/_init_azure_service_bus.py +++ b/pyatlan_v9/model/assets/_init_azure_service_bus.py @@ -8,14 +8,14 @@ This module provides convenient imports for all AzureServiceBus types and their Related variants. """ +from .azure_service_bus import AzureServiceBus +from .azure_service_bus_namespace import AzureServiceBusNamespace from .azure_service_bus_related import ( RelatedAzureServiceBus, RelatedAzureServiceBusNamespace, RelatedAzureServiceBusSchema, RelatedAzureServiceBusTopic, ) -from .azure_service_bus import AzureServiceBus -from .azure_service_bus_namespace import AzureServiceBusNamespace from .azure_service_bus_schema import AzureServiceBusSchema from .azure_service_bus_topic import AzureServiceBusTopic diff --git a/pyatlan_v9/model/assets/_init_bigquery.py b/pyatlan_v9/model/assets/_init_bigquery.py index 0376c1575..cb9747ed5 100644 --- a/pyatlan_v9/model/assets/_init_bigquery.py +++ b/pyatlan_v9/model/assets/_init_bigquery.py @@ -8,10 +8,7 @@ This module provides convenient imports for all Bigquery types and their Related variants. """ -from .bigquery_related import ( - RelatedBigqueryRoutine, - RelatedBigqueryTag, -) +from .bigquery_related import RelatedBigqueryRoutine, RelatedBigqueryTag from .bigquery_routine import BigqueryRoutine __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_business_policy.py b/pyatlan_v9/model/assets/_init_business_policy.py index 95fb820e8..c96d6d1ad 100644 --- a/pyatlan_v9/model/assets/_init_business_policy.py +++ b/pyatlan_v9/model/assets/_init_business_policy.py @@ -8,13 +8,13 @@ This module provides convenient imports for all BusinessPolicy types and their Related variants. """ +from .business_policy import BusinessPolicy from .business_policy_related import ( RelatedBusinessPolicy, RelatedBusinessPolicyException, RelatedBusinessPolicyIncident, RelatedBusinessPolicyLog, ) -from .business_policy import BusinessPolicy __all__ = [ "BusinessPolicy", diff --git a/pyatlan_v9/model/assets/_init_cassandra.py b/pyatlan_v9/model/assets/_init_cassandra.py index 015654821..4291f62ac 100644 --- a/pyatlan_v9/model/assets/_init_cassandra.py +++ b/pyatlan_v9/model/assets/_init_cassandra.py @@ -8,6 +8,10 @@ This module provides convenient imports for all Cassandra types and their Related variants. """ +from .cassandra import Cassandra +from .cassandra_column import CassandraColumn +from .cassandra_index import CassandraIndex +from .cassandra_keyspace import CassandraKeyspace from .cassandra_related import ( RelatedCassandra, RelatedCassandraColumn, @@ -16,10 +20,6 @@ RelatedCassandraTable, RelatedCassandraView, ) -from .cassandra import Cassandra -from .cassandra_column import CassandraColumn -from .cassandra_index import CassandraIndex -from .cassandra_keyspace import CassandraKeyspace from .cassandra_table import CassandraTable from .cassandra_view import CassandraView diff --git a/pyatlan_v9/model/assets/_init_catalog.py b/pyatlan_v9/model/assets/_init_catalog.py index aebc7a055..418322b1a 100644 --- a/pyatlan_v9/model/assets/_init_catalog.py +++ b/pyatlan_v9/model/assets/_init_catalog.py @@ -8,6 +8,8 @@ This module provides convenient imports for all Catalog types and their Related variants. """ +from .bi import BI +from .catalog import Catalog from .catalog_related import ( RelatedBI, RelatedCatalog, @@ -17,8 +19,6 @@ RelatedObjectStore, RelatedSaaS, ) -from .catalog import Catalog -from .bi import BI from .event_store import EventStore from .insight import Insight from .no_sql import NoSQL diff --git a/pyatlan_v9/model/assets/_init_cloud.py b/pyatlan_v9/model/assets/_init_cloud.py index 369d1d1e1..e6f365e71 100644 --- a/pyatlan_v9/model/assets/_init_cloud.py +++ b/pyatlan_v9/model/assets/_init_cloud.py @@ -8,15 +8,10 @@ This module provides convenient imports for all Cloud types and their Related variants. """ -from .cloud_related import ( - RelatedAWS, - RelatedAzure, - RelatedCloud, - RelatedGoogle, -) -from .cloud import Cloud from .aws import AWS from .azure import Azure +from .cloud import Cloud +from .cloud_related import RelatedAWS, RelatedAzure, RelatedCloud, RelatedGoogle from .google import Google __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_cognite.py b/pyatlan_v9/model/assets/_init_cognite.py index 1b899d01a..2c1ce389a 100644 --- a/pyatlan_v9/model/assets/_init_cognite.py +++ b/pyatlan_v9/model/assets/_init_cognite.py @@ -8,6 +8,11 @@ This module provides convenient imports for all Cognite types and their Related variants. """ +from .cognite import Cognite +from .cognite3d_model import Cognite3DModel +from .cognite_asset import CogniteAsset +from .cognite_event import CogniteEvent +from .cognite_file import CogniteFile from .cognite_related import ( RelatedCognite, RelatedCognite3DModel, @@ -17,11 +22,6 @@ RelatedCogniteSequence, RelatedCogniteTimeSeries, ) -from .cognite import Cognite -from .cognite3d_model import Cognite3DModel -from .cognite_asset import CogniteAsset -from .cognite_event import CogniteEvent -from .cognite_file import CogniteFile from .cognite_sequence import CogniteSequence from .cognite_time_series import CogniteTimeSeries diff --git a/pyatlan_v9/model/assets/_init_cognos.py b/pyatlan_v9/model/assets/_init_cognos.py index 9a58f06be..86caab413 100644 --- a/pyatlan_v9/model/assets/_init_cognos.py +++ b/pyatlan_v9/model/assets/_init_cognos.py @@ -8,6 +8,16 @@ This module provides convenient imports for all Cognos types and their Related variants. """ +from .cognos import Cognos +from .cognos_column import CognosColumn +from .cognos_dashboard import CognosDashboard +from .cognos_dataset import CognosDataset +from .cognos_datasource import CognosDatasource +from .cognos_exploration import CognosExploration +from .cognos_file import CognosFile +from .cognos_folder import CognosFolder +from .cognos_module import CognosModule +from .cognos_package import CognosPackage from .cognos_related import ( RelatedCognos, RelatedCognosColumn, @@ -21,16 +31,6 @@ RelatedCognosPackage, RelatedCognosReport, ) -from .cognos import Cognos -from .cognos_column import CognosColumn -from .cognos_dashboard import CognosDashboard -from .cognos_dataset import CognosDataset -from .cognos_datasource import CognosDatasource -from .cognos_exploration import CognosExploration -from .cognos_file import CognosFile -from .cognos_folder import CognosFolder -from .cognos_module import CognosModule -from .cognos_package import CognosPackage from .cognos_report import CognosReport __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_connection.py b/pyatlan_v9/model/assets/_init_connection.py index 3ee148c44..c68a5162c 100644 --- a/pyatlan_v9/model/assets/_init_connection.py +++ b/pyatlan_v9/model/assets/_init_connection.py @@ -8,8 +8,8 @@ This module provides convenient imports for all Connection types and their Related variants. """ -from .connection_related import RelatedConnection from .connection import Connection +from .connection_related import RelatedConnection __all__ = [ "Connection", diff --git a/pyatlan_v9/model/assets/_init_context.py b/pyatlan_v9/model/assets/_init_context.py index 7751b1b1c..6493c6aa9 100644 --- a/pyatlan_v9/model/assets/_init_context.py +++ b/pyatlan_v9/model/assets/_init_context.py @@ -8,13 +8,13 @@ This module provides convenient imports for all Context types and their Related variants. """ +from .context import Context +from .context_artifact import ContextArtifact from .context_related import ( RelatedContext, RelatedContextArtifact, RelatedContextRepository, ) -from .context import Context -from .context_artifact import ContextArtifact from .context_repository import ContextRepository __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_cosmos_mongo_db.py b/pyatlan_v9/model/assets/_init_cosmos_mongo_db.py index d8dfc4deb..ded733d1d 100644 --- a/pyatlan_v9/model/assets/_init_cosmos_mongo_db.py +++ b/pyatlan_v9/model/assets/_init_cosmos_mongo_db.py @@ -8,16 +8,16 @@ This module provides convenient imports for all CosmosMongoDB types and their Related variants. """ +from .cosmos_mongo_db import CosmosMongoDB +from .cosmos_mongo_db_account import CosmosMongoDBAccount +from .cosmos_mongo_db_collection import CosmosMongoDBCollection +from .cosmos_mongo_db_database import CosmosMongoDBDatabase from .cosmos_mongo_db_related import ( RelatedCosmosMongoDB, RelatedCosmosMongoDBAccount, RelatedCosmosMongoDBCollection, RelatedCosmosMongoDBDatabase, ) -from .cosmos_mongo_db import CosmosMongoDB -from .cosmos_mongo_db_account import CosmosMongoDBAccount -from .cosmos_mongo_db_collection import CosmosMongoDBCollection -from .cosmos_mongo_db_database import CosmosMongoDBDatabase __all__ = [ "CosmosMongoDB", diff --git a/pyatlan_v9/model/assets/_init_cube.py b/pyatlan_v9/model/assets/_init_cube.py index 87d85adff..719b15419 100644 --- a/pyatlan_v9/model/assets/_init_cube.py +++ b/pyatlan_v9/model/assets/_init_cube.py @@ -8,6 +8,10 @@ This module provides convenient imports for all Cube types and their Related variants. """ +from .cube import Cube +from .cube_dimension import CubeDimension +from .cube_field import CubeField +from .cube_hierarchy import CubeHierarchy from .cube_related import ( RelatedCube, RelatedCubeDimension, @@ -16,10 +20,6 @@ RelatedMultiDimensionalDataset, ) from .multi_dimensional_dataset import MultiDimensionalDataset -from .cube import Cube -from .cube_dimension import CubeDimension -from .cube_field import CubeField -from .cube_hierarchy import CubeHierarchy __all__ = [ "Cube", diff --git a/pyatlan_v9/model/assets/_init_custom.py b/pyatlan_v9/model/assets/_init_custom.py index de8e87ff6..b3b642e3f 100644 --- a/pyatlan_v9/model/assets/_init_custom.py +++ b/pyatlan_v9/model/assets/_init_custom.py @@ -8,12 +8,9 @@ This module provides convenient imports for all Custom types and their Related variants. """ -from .custom_related import ( - RelatedCustom, - RelatedCustomEntity, -) from .custom import Custom from .custom_entity import CustomEntity +from .custom_related import RelatedCustom, RelatedCustomEntity __all__ = [ "Custom", diff --git a/pyatlan_v9/model/assets/_init_data_contract.py b/pyatlan_v9/model/assets/_init_data_contract.py index bb762d20f..3406099c1 100644 --- a/pyatlan_v9/model/assets/_init_data_contract.py +++ b/pyatlan_v9/model/assets/_init_data_contract.py @@ -8,8 +8,8 @@ This module provides convenient imports for all DataContract types and their Related variants. """ -from .data_contract_related import RelatedDataContract from .data_contract import DataContract +from .data_contract_related import RelatedDataContract __all__ = [ "DataContract", diff --git a/pyatlan_v9/model/assets/_init_data_mesh.py b/pyatlan_v9/model/assets/_init_data_mesh.py index d1b353487..c45cd5c2e 100644 --- a/pyatlan_v9/model/assets/_init_data_mesh.py +++ b/pyatlan_v9/model/assets/_init_data_mesh.py @@ -8,6 +8,9 @@ This module provides convenient imports for all DataMesh types and their Related variants. """ +from .data_domain import DataDomain +from .data_mesh import DataMesh +from .data_mesh_dataset import DataMeshDataset from .data_mesh_related import ( RelatedDataDomain, RelatedDataMesh, @@ -16,9 +19,6 @@ RelatedStakeholder, RelatedStakeholderTitle, ) -from .data_mesh import DataMesh -from .data_domain import DataDomain -from .data_mesh_dataset import DataMeshDataset from .data_product import DataProduct __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_data_quality.py b/pyatlan_v9/model/assets/_init_data_quality.py index 92d561b12..cc21c1a75 100644 --- a/pyatlan_v9/model/assets/_init_data_quality.py +++ b/pyatlan_v9/model/assets/_init_data_quality.py @@ -8,13 +8,13 @@ This module provides convenient imports for all DataQuality types and their Related variants. """ +from .data_quality import DataQuality from .data_quality_related import ( RelatedDataQuality, RelatedDataQualityRule, RelatedDataQualityRuleTemplate, RelatedMetric, ) -from .data_quality import DataQuality from .data_quality_rule import DataQualityRule from .data_quality_rule_template import DataQualityRuleTemplate from .metric import Metric diff --git a/pyatlan_v9/model/assets/_init_data_studio.py b/pyatlan_v9/model/assets/_init_data_studio.py index 95e10d2c3..30eb591f7 100644 --- a/pyatlan_v9/model/assets/_init_data_studio.py +++ b/pyatlan_v9/model/assets/_init_data_studio.py @@ -8,12 +8,9 @@ This module provides convenient imports for all DataStudio types and their Related variants. """ -from .data_studio_related import ( - RelatedDataStudio, - RelatedDataStudioAsset, -) from .data_studio import DataStudio from .data_studio_asset import DataStudioAsset +from .data_studio_related import RelatedDataStudio, RelatedDataStudioAsset __all__ = [ "DataStudio", diff --git a/pyatlan_v9/model/assets/_init_databricks.py b/pyatlan_v9/model/assets/_init_databricks.py index 1699dab97..242cf16be 100644 --- a/pyatlan_v9/model/assets/_init_databricks.py +++ b/pyatlan_v9/model/assets/_init_databricks.py @@ -8,6 +8,15 @@ This module provides convenient imports for all Databricks types and their Related variants. """ +from .databricks import Databricks +from .databricks_ai_model_context import DatabricksAIModelContext +from .databricks_ai_model_version import DatabricksAIModelVersion +from .databricks_dashboard import DatabricksDashboard +from .databricks_external_location import DatabricksExternalLocation +from .databricks_external_location_path import DatabricksExternalLocationPath +from .databricks_genie_agent import DatabricksGenieAgent +from .databricks_metric_view import DatabricksMetricView +from .databricks_notebook import DatabricksNotebook from .databricks_related import ( RelatedDatabricks, RelatedDatabricksAIModelContext, @@ -22,15 +31,6 @@ RelatedDatabricksVolume, RelatedDatabricksVolumePath, ) -from .databricks import Databricks -from .databricks_ai_model_context import DatabricksAIModelContext -from .databricks_ai_model_version import DatabricksAIModelVersion -from .databricks_dashboard import DatabricksDashboard -from .databricks_external_location import DatabricksExternalLocation -from .databricks_external_location_path import DatabricksExternalLocationPath -from .databricks_genie_agent import DatabricksGenieAgent -from .databricks_metric_view import DatabricksMetricView -from .databricks_notebook import DatabricksNotebook from .databricks_volume import DatabricksVolume from .databricks_volume_path import DatabricksVolumePath diff --git a/pyatlan_v9/model/assets/_init_dataverse.py b/pyatlan_v9/model/assets/_init_dataverse.py index 019cfb607..79ae94be0 100644 --- a/pyatlan_v9/model/assets/_init_dataverse.py +++ b/pyatlan_v9/model/assets/_init_dataverse.py @@ -8,14 +8,14 @@ This module provides convenient imports for all Dataverse types and their Related variants. """ +from .dataverse import Dataverse +from .dataverse_attribute import DataverseAttribute +from .dataverse_entity import DataverseEntity from .dataverse_related import ( RelatedDataverse, RelatedDataverseAttribute, RelatedDataverseEntity, ) -from .dataverse import Dataverse -from .dataverse_attribute import DataverseAttribute -from .dataverse_entity import DataverseEntity __all__ = [ "Dataverse", diff --git a/pyatlan_v9/model/assets/_init_dbt.py b/pyatlan_v9/model/assets/_init_dbt.py index 7cb4f04de..3d38b1b3a 100644 --- a/pyatlan_v9/model/assets/_init_dbt.py +++ b/pyatlan_v9/model/assets/_init_dbt.py @@ -8,6 +8,15 @@ This module provides convenient imports for all Dbt types and their Related variants. """ +from .dbt import Dbt +from .dbt_column_process import DbtColumnProcess +from .dbt_dimension import DbtDimension +from .dbt_entity import DbtEntity +from .dbt_measure import DbtMeasure +from .dbt_metric import DbtMetric +from .dbt_model import DbtModel +from .dbt_model_column import DbtModelColumn +from .dbt_process import DbtProcess from .dbt_related import ( RelatedDbt, RelatedDbtColumnProcess, @@ -24,15 +33,6 @@ RelatedDbtTag, RelatedDbtTest, ) -from .dbt import Dbt -from .dbt_column_process import DbtColumnProcess -from .dbt_dimension import DbtDimension -from .dbt_entity import DbtEntity -from .dbt_measure import DbtMeasure -from .dbt_metric import DbtMetric -from .dbt_model import DbtModel -from .dbt_model_column import DbtModelColumn -from .dbt_process import DbtProcess from .dbt_seed import DbtSeed from .dbt_semantic_model import DbtSemanticModel from .dbt_source import DbtSource diff --git a/pyatlan_v9/model/assets/_init_document_db.py b/pyatlan_v9/model/assets/_init_document_db.py index fe0c74c68..5d95c255b 100644 --- a/pyatlan_v9/model/assets/_init_document_db.py +++ b/pyatlan_v9/model/assets/_init_document_db.py @@ -8,14 +8,14 @@ This module provides convenient imports for all DocumentDB types and their Related variants. """ +from .document_db import DocumentDB +from .document_db_collection import DocumentDBCollection +from .document_db_database import DocumentDBDatabase from .document_db_related import ( RelatedDocumentDB, RelatedDocumentDBCollection, RelatedDocumentDBDatabase, ) -from .document_db import DocumentDB -from .document_db_collection import DocumentDBCollection -from .document_db_database import DocumentDBDatabase __all__ = [ "DocumentDB", diff --git a/pyatlan_v9/model/assets/_init_domo.py b/pyatlan_v9/model/assets/_init_domo.py index 46b372286..8f69c1bf8 100644 --- a/pyatlan_v9/model/assets/_init_domo.py +++ b/pyatlan_v9/model/assets/_init_domo.py @@ -8,6 +8,11 @@ This module provides convenient imports for all Domo types and their Related variants. """ +from .domo import Domo +from .domo_card import DomoCard +from .domo_dashboard import DomoDashboard +from .domo_dataset import DomoDataset +from .domo_dataset_column import DomoDatasetColumn from .domo_related import ( RelatedDomo, RelatedDomoCard, @@ -15,11 +20,6 @@ RelatedDomoDataset, RelatedDomoDatasetColumn, ) -from .domo import Domo -from .domo_card import DomoCard -from .domo_dashboard import DomoDashboard -from .domo_dataset import DomoDataset -from .domo_dataset_column import DomoDatasetColumn __all__ = [ "Domo", diff --git a/pyatlan_v9/model/assets/_init_dremio.py b/pyatlan_v9/model/assets/_init_dremio.py index 24355d454..8dfcba66f 100644 --- a/pyatlan_v9/model/assets/_init_dremio.py +++ b/pyatlan_v9/model/assets/_init_dremio.py @@ -8,6 +8,10 @@ This module provides convenient imports for all Dremio types and their Related variants. """ +from .dremio import Dremio +from .dremio_column import DremioColumn +from .dremio_folder import DremioFolder +from .dremio_physical_dataset import DremioPhysicalDataset from .dremio_related import ( RelatedDremio, RelatedDremioColumn, @@ -17,10 +21,6 @@ RelatedDremioSpace, RelatedDremioVirtualDataset, ) -from .dremio import Dremio -from .dremio_column import DremioColumn -from .dremio_folder import DremioFolder -from .dremio_physical_dataset import DremioPhysicalDataset from .dremio_source import DremioSource from .dremio_space import DremioSpace from .dremio_virtual_dataset import DremioVirtualDataset diff --git a/pyatlan_v9/model/assets/_init_dynamo_db.py b/pyatlan_v9/model/assets/_init_dynamo_db.py index 74fe7e66d..20156e55e 100644 --- a/pyatlan_v9/model/assets/_init_dynamo_db.py +++ b/pyatlan_v9/model/assets/_init_dynamo_db.py @@ -8,6 +8,8 @@ This module provides convenient imports for all DynamoDB types and their Related variants. """ +from .dynamo_db import DynamoDB +from .dynamo_db_attribute import DynamoDBAttribute from .dynamo_db_related import ( RelatedDynamoDB, RelatedDynamoDBAttribute, @@ -16,8 +18,6 @@ RelatedDynamoDBSecondaryIndex, RelatedDynamoDBTable, ) -from .dynamo_db import DynamoDB -from .dynamo_db_attribute import DynamoDBAttribute from .dynamo_db_secondary_index import DynamoDBSecondaryIndex from .dynamo_db_table import DynamoDBTable diff --git a/pyatlan_v9/model/assets/_init_fabric.py b/pyatlan_v9/model/assets/_init_fabric.py index 6e95fb120..14661b43d 100644 --- a/pyatlan_v9/model/assets/_init_fabric.py +++ b/pyatlan_v9/model/assets/_init_fabric.py @@ -8,13 +8,20 @@ This module provides convenient imports for all Fabric types and their Related variants. """ +from .fabric import Fabric +from .fabric_activity import FabricActivity +from .fabric_dashboard import FabricDashboard +from .fabric_data_pipeline import FabricDataPipeline +from .fabric_dataflow import FabricDataflow +from .fabric_dataflow_entity_column import FabricDataflowEntityColumn +from .fabric_page import FabricPage from .fabric_related import ( RelatedFabric, RelatedFabricActivity, RelatedFabricDashboard, - RelatedFabricDataPipeline, RelatedFabricDataflow, RelatedFabricDataflowEntityColumn, + RelatedFabricDataPipeline, RelatedFabricPage, RelatedFabricReport, RelatedFabricSemanticModel, @@ -24,13 +31,6 @@ RelatedFabricVisual, RelatedFabricWorkspace, ) -from .fabric import Fabric -from .fabric_activity import FabricActivity -from .fabric_dashboard import FabricDashboard -from .fabric_data_pipeline import FabricDataPipeline -from .fabric_dataflow import FabricDataflow -from .fabric_dataflow_entity_column import FabricDataflowEntityColumn -from .fabric_page import FabricPage from .fabric_report import FabricReport from .fabric_semantic_model import FabricSemanticModel from .fabric_semantic_model_measure import FabricSemanticModelMeasure diff --git a/pyatlan_v9/model/assets/_init_fivetran.py b/pyatlan_v9/model/assets/_init_fivetran.py index 2d8d373da..04f467fde 100644 --- a/pyatlan_v9/model/assets/_init_fivetran.py +++ b/pyatlan_v9/model/assets/_init_fivetran.py @@ -8,12 +8,9 @@ This module provides convenient imports for all Fivetran types and their Related variants. """ -from .fivetran_related import ( - RelatedFivetran, - RelatedFivetranConnector, -) from .fivetran import Fivetran from .fivetran_connector import FivetranConnector +from .fivetran_related import RelatedFivetran, RelatedFivetranConnector __all__ = [ "Fivetran", diff --git a/pyatlan_v9/model/assets/_init_flow.py b/pyatlan_v9/model/assets/_init_flow.py index 8d9c57373..c48a9aac6 100644 --- a/pyatlan_v9/model/assets/_init_flow.py +++ b/pyatlan_v9/model/assets/_init_flow.py @@ -8,6 +8,14 @@ This module provides convenient imports for all Flow types and their Related variants. """ +from .flow import Flow +from .flow_control_operation import FlowControlOperation +from .flow_dataset import FlowDataset +from .flow_dataset_operation import FlowDatasetOperation +from .flow_field import FlowField +from .flow_field_operation import FlowFieldOperation +from .flow_folder import FlowFolder +from .flow_project import FlowProject from .flow_related import ( RelatedFlow, RelatedFlowControlOperation, @@ -19,14 +27,6 @@ RelatedFlowProject, RelatedFlowReusableUnit, ) -from .flow import Flow -from .flow_control_operation import FlowControlOperation -from .flow_dataset import FlowDataset -from .flow_dataset_operation import FlowDatasetOperation -from .flow_field import FlowField -from .flow_field_operation import FlowFieldOperation -from .flow_folder import FlowFolder -from .flow_project import FlowProject from .flow_reusable_unit import FlowReusableUnit __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_form.py b/pyatlan_v9/model/assets/_init_form.py index 38611274d..4463502e1 100644 --- a/pyatlan_v9/model/assets/_init_form.py +++ b/pyatlan_v9/model/assets/_init_form.py @@ -8,11 +8,8 @@ This module provides convenient imports for all Form types and their Related variants. """ -from .form_related import ( - RelatedForm, - RelatedResponse, -) from .form import Form +from .form_related import RelatedForm, RelatedResponse __all__ = [ "Form", diff --git a/pyatlan_v9/model/assets/_init_gcp_dataplex.py b/pyatlan_v9/model/assets/_init_gcp_dataplex.py index e58ade95d..0e68e568b 100644 --- a/pyatlan_v9/model/assets/_init_gcp_dataplex.py +++ b/pyatlan_v9/model/assets/_init_gcp_dataplex.py @@ -8,12 +8,9 @@ This module provides convenient imports for all GCPDataplex types and their Related variants. """ -from .gcp_dataplex_related import ( - RelatedGCPDataplex, - RelatedGCPDataplexAspectType, -) from .gcp_dataplex import GCPDataplex from .gcp_dataplex_aspect_type import GCPDataplexAspectType +from .gcp_dataplex_related import RelatedGCPDataplex, RelatedGCPDataplexAspectType __all__ = [ "GCPDataplex", diff --git a/pyatlan_v9/model/assets/_init_gcs.py b/pyatlan_v9/model/assets/_init_gcs.py index fb25f1ed5..7631cc4cf 100644 --- a/pyatlan_v9/model/assets/_init_gcs.py +++ b/pyatlan_v9/model/assets/_init_gcs.py @@ -8,14 +8,10 @@ This module provides convenient imports for all GCS types and their Related variants. """ -from .gcs_related import ( - RelatedGCS, - RelatedGCSBucket, - RelatedGCSObject, -) from .gcs import GCS from .gcs_bucket import GCSBucket from .gcs_object import GCSObject +from .gcs_related import RelatedGCS, RelatedGCSBucket, RelatedGCSObject __all__ = [ "GCS", diff --git a/pyatlan_v9/model/assets/_init_gtc.py b/pyatlan_v9/model/assets/_init_gtc.py index 2d8b5b332..aacc27e04 100644 --- a/pyatlan_v9/model/assets/_init_gtc.py +++ b/pyatlan_v9/model/assets/_init_gtc.py @@ -8,14 +8,14 @@ This module provides convenient imports for all GTC types and their Related variants. """ +from .atlas_glossary import AtlasGlossary +from .atlas_glossary_category import AtlasGlossaryCategory +from .atlas_glossary_term import AtlasGlossaryTerm from .gtc_related import ( RelatedAtlasGlossary, RelatedAtlasGlossaryCategory, RelatedAtlasGlossaryTerm, ) -from .atlas_glossary import AtlasGlossary -from .atlas_glossary_category import AtlasGlossaryCategory -from .atlas_glossary_term import AtlasGlossaryTerm __all__ = [ "AtlasGlossary", diff --git a/pyatlan_v9/model/assets/_init_iceberg.py b/pyatlan_v9/model/assets/_init_iceberg.py index 68dcf0354..1c10d0573 100644 --- a/pyatlan_v9/model/assets/_init_iceberg.py +++ b/pyatlan_v9/model/assets/_init_iceberg.py @@ -8,6 +8,10 @@ This module provides convenient imports for all Iceberg types and their Related variants. """ +from .iceberg import Iceberg +from .iceberg_catalog import IcebergCatalog +from .iceberg_column import IcebergColumn +from .iceberg_namespace import IcebergNamespace from .iceberg_related import ( RelatedIceberg, RelatedIcebergCatalog, @@ -15,10 +19,6 @@ RelatedIcebergNamespace, RelatedIcebergTable, ) -from .iceberg import Iceberg -from .iceberg_catalog import IcebergCatalog -from .iceberg_column import IcebergColumn -from .iceberg_namespace import IcebergNamespace from .iceberg_table import IcebergTable __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_kafka.py b/pyatlan_v9/model/assets/_init_kafka.py index bf4a225ba..3f37ec3fe 100644 --- a/pyatlan_v9/model/assets/_init_kafka.py +++ b/pyatlan_v9/model/assets/_init_kafka.py @@ -8,6 +8,10 @@ This module provides convenient imports for all Kafka types and their Related variants. """ +from .kafka import Kafka +from .kafka_cluster import KafkaCluster +from .kafka_consumer_group import KafkaConsumerGroup +from .kafka_field import KafkaField from .kafka_related import ( RelatedAzureEventHub, RelatedAzureEventHubConsumerGroup, @@ -18,10 +22,6 @@ RelatedKafkaTag, RelatedKafkaTopic, ) -from .kafka import Kafka -from .kafka_cluster import KafkaCluster -from .kafka_consumer_group import KafkaConsumerGroup -from .kafka_field import KafkaField from .kafka_tag import KafkaTag from .kafka_topic import KafkaTopic diff --git a/pyatlan_v9/model/assets/_init_knowledge.py b/pyatlan_v9/model/assets/_init_knowledge.py index 6045775ce..96c6549cb 100644 --- a/pyatlan_v9/model/assets/_init_knowledge.py +++ b/pyatlan_v9/model/assets/_init_knowledge.py @@ -8,14 +8,14 @@ This module provides convenient imports for all Knowledge types and their Related variants. """ +from .knowledge import Knowledge +from .knowledge_file import KnowledgeFile +from .knowledge_folder import KnowledgeFolder from .knowledge_related import ( RelatedKnowledge, RelatedKnowledgeFile, RelatedKnowledgeFolder, ) -from .knowledge import Knowledge -from .knowledge_file import KnowledgeFile -from .knowledge_folder import KnowledgeFolder __all__ = [ "Knowledge", diff --git a/pyatlan_v9/model/assets/_init_looker.py b/pyatlan_v9/model/assets/_init_looker.py index ebbbd0bd9..63a34972f 100644 --- a/pyatlan_v9/model/assets/_init_looker.py +++ b/pyatlan_v9/model/assets/_init_looker.py @@ -8,6 +8,15 @@ This module provides convenient imports for all Looker types and their Related variants. """ +from .looker import Looker +from .looker_dashboard import LookerDashboard +from .looker_explore import LookerExplore +from .looker_field import LookerField +from .looker_folder import LookerFolder +from .looker_look import LookerLook +from .looker_model import LookerModel +from .looker_project import LookerProject +from .looker_query import LookerQuery from .looker_related import ( RelatedLooker, RelatedLookerDashboard, @@ -21,15 +30,6 @@ RelatedLookerTile, RelatedLookerView, ) -from .looker import Looker -from .looker_dashboard import LookerDashboard -from .looker_explore import LookerExplore -from .looker_field import LookerField -from .looker_folder import LookerFolder -from .looker_look import LookerLook -from .looker_model import LookerModel -from .looker_project import LookerProject -from .looker_query import LookerQuery from .looker_tile import LookerTile from .looker_view import LookerView diff --git a/pyatlan_v9/model/assets/_init_matillion.py b/pyatlan_v9/model/assets/_init_matillion.py index fdd5ff9bc..11cb1c09c 100644 --- a/pyatlan_v9/model/assets/_init_matillion.py +++ b/pyatlan_v9/model/assets/_init_matillion.py @@ -8,6 +8,11 @@ This module provides convenient imports for all Matillion types and their Related variants. """ +from .matillion import Matillion +from .matillion_component import MatillionComponent +from .matillion_group import MatillionGroup +from .matillion_job import MatillionJob +from .matillion_project import MatillionProject from .matillion_related import ( RelatedMatillion, RelatedMatillionComponent, @@ -15,11 +20,6 @@ RelatedMatillionJob, RelatedMatillionProject, ) -from .matillion import Matillion -from .matillion_component import MatillionComponent -from .matillion_group import MatillionGroup -from .matillion_job import MatillionJob -from .matillion_project import MatillionProject __all__ = [ "Matillion", diff --git a/pyatlan_v9/model/assets/_init_metabase.py b/pyatlan_v9/model/assets/_init_metabase.py index 3366c0c7f..06eb5ea28 100644 --- a/pyatlan_v9/model/assets/_init_metabase.py +++ b/pyatlan_v9/model/assets/_init_metabase.py @@ -8,16 +8,16 @@ This module provides convenient imports for all Metabase types and their Related variants. """ +from .metabase import Metabase +from .metabase_collection import MetabaseCollection +from .metabase_dashboard import MetabaseDashboard +from .metabase_question import MetabaseQuestion from .metabase_related import ( RelatedMetabase, RelatedMetabaseCollection, RelatedMetabaseDashboard, RelatedMetabaseQuestion, ) -from .metabase import Metabase -from .metabase_collection import MetabaseCollection -from .metabase_dashboard import MetabaseDashboard -from .metabase_question import MetabaseQuestion __all__ = [ "Metabase", diff --git a/pyatlan_v9/model/assets/_init_micro_strategy.py b/pyatlan_v9/model/assets/_init_micro_strategy.py index cb83792df..3bbdb6441 100644 --- a/pyatlan_v9/model/assets/_init_micro_strategy.py +++ b/pyatlan_v9/model/assets/_init_micro_strategy.py @@ -8,6 +8,15 @@ This module provides convenient imports for all MicroStrategy types and their Related variants. """ +from .micro_strategy import MicroStrategy +from .micro_strategy_attribute import MicroStrategyAttribute +from .micro_strategy_column import MicroStrategyColumn +from .micro_strategy_cube import MicroStrategyCube +from .micro_strategy_document import MicroStrategyDocument +from .micro_strategy_dossier import MicroStrategyDossier +from .micro_strategy_fact import MicroStrategyFact +from .micro_strategy_metric import MicroStrategyMetric +from .micro_strategy_project import MicroStrategyProject from .micro_strategy_related import ( RelatedMicroStrategy, RelatedMicroStrategyAttribute, @@ -21,15 +30,6 @@ RelatedMicroStrategyReport, RelatedMicroStrategyVisualization, ) -from .micro_strategy import MicroStrategy -from .micro_strategy_attribute import MicroStrategyAttribute -from .micro_strategy_column import MicroStrategyColumn -from .micro_strategy_cube import MicroStrategyCube -from .micro_strategy_document import MicroStrategyDocument -from .micro_strategy_dossier import MicroStrategyDossier -from .micro_strategy_fact import MicroStrategyFact -from .micro_strategy_metric import MicroStrategyMetric -from .micro_strategy_project import MicroStrategyProject from .micro_strategy_report import MicroStrategyReport from .micro_strategy_visualization import MicroStrategyVisualization diff --git a/pyatlan_v9/model/assets/_init_mode.py b/pyatlan_v9/model/assets/_init_mode.py index 4ab2b2d3f..4d843787a 100644 --- a/pyatlan_v9/model/assets/_init_mode.py +++ b/pyatlan_v9/model/assets/_init_mode.py @@ -8,6 +8,10 @@ This module provides convenient imports for all Mode types and their Related variants. """ +from .mode import Mode +from .mode_chart import ModeChart +from .mode_collection import ModeCollection +from .mode_query import ModeQuery from .mode_related import ( RelatedMode, RelatedModeChart, @@ -16,10 +20,6 @@ RelatedModeReport, RelatedModeWorkspace, ) -from .mode import Mode -from .mode_chart import ModeChart -from .mode_collection import ModeCollection -from .mode_query import ModeQuery from .mode_report import ModeReport from .mode_workspace import ModeWorkspace diff --git a/pyatlan_v9/model/assets/_init_model.py b/pyatlan_v9/model/assets/_init_model.py index 62b08c361..87eb2aff5 100644 --- a/pyatlan_v9/model/assets/_init_model.py +++ b/pyatlan_v9/model/assets/_init_model.py @@ -8,6 +8,12 @@ This module provides convenient imports for all Model types and their Related variants. """ +from .model import Model +from .model_attribute import ModelAttribute +from .model_attribute_association import ModelAttributeAssociation +from .model_data_model import ModelDataModel +from .model_entity import ModelEntity +from .model_entity_association import ModelEntityAssociation from .model_related import ( RelatedModel, RelatedModelAttribute, @@ -17,12 +23,6 @@ RelatedModelEntityAssociation, RelatedModelVersion, ) -from .model import Model -from .model_attribute import ModelAttribute -from .model_attribute_association import ModelAttributeAssociation -from .model_data_model import ModelDataModel -from .model_entity import ModelEntity -from .model_entity_association import ModelEntityAssociation from .model_version import ModelVersion __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_mongo_db.py b/pyatlan_v9/model/assets/_init_mongo_db.py index 4bf44c463..3968c185e 100644 --- a/pyatlan_v9/model/assets/_init_mongo_db.py +++ b/pyatlan_v9/model/assets/_init_mongo_db.py @@ -8,14 +8,14 @@ This module provides convenient imports for all MongoDB types and their Related variants. """ +from .mongo_db import MongoDB +from .mongo_db_collection import MongoDBCollection +from .mongo_db_database import MongoDBDatabase from .mongo_db_related import ( RelatedMongoDB, RelatedMongoDBCollection, RelatedMongoDBDatabase, ) -from .mongo_db import MongoDB -from .mongo_db_collection import MongoDBCollection -from .mongo_db_database import MongoDBDatabase __all__ = [ "MongoDB", diff --git a/pyatlan_v9/model/assets/_init_monte_carlo.py b/pyatlan_v9/model/assets/_init_monte_carlo.py index 2e1b21264..071d7e61e 100644 --- a/pyatlan_v9/model/assets/_init_monte_carlo.py +++ b/pyatlan_v9/model/assets/_init_monte_carlo.py @@ -8,14 +8,10 @@ This module provides convenient imports for all MonteCarlo types and their Related variants. """ -from .monte_carlo_related import ( - RelatedMCIncident, - RelatedMCMonitor, - RelatedMonteCarlo, -) -from .monte_carlo import MonteCarlo from .mc_incident import MCIncident from .mc_monitor import MCMonitor +from .monte_carlo import MonteCarlo +from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor, RelatedMonteCarlo __all__ = [ "MCIncident", diff --git a/pyatlan_v9/model/assets/_init_namespace.py b/pyatlan_v9/model/assets/_init_namespace.py index 46415bb8b..022035347 100644 --- a/pyatlan_v9/model/assets/_init_namespace.py +++ b/pyatlan_v9/model/assets/_init_namespace.py @@ -8,14 +8,10 @@ This module provides convenient imports for all Namespace types and their Related variants. """ -from .namespace_related import ( - RelatedCollection, - RelatedFolder, - RelatedNamespace, -) -from .namespace import Namespace from .collection import Collection from .folder import Folder +from .namespace import Namespace +from .namespace_related import RelatedCollection, RelatedFolder, RelatedNamespace __all__ = [ "Collection", diff --git a/pyatlan_v9/model/assets/_init_notebook.py b/pyatlan_v9/model/assets/_init_notebook.py index 1ad01bd46..cd518b86a 100644 --- a/pyatlan_v9/model/assets/_init_notebook.py +++ b/pyatlan_v9/model/assets/_init_notebook.py @@ -8,8 +8,8 @@ This module provides convenient imports for all Notebook types and their Related variants. """ -from .notebook_related import RelatedNotebook from .notebook import Notebook +from .notebook_related import RelatedNotebook __all__ = [ "Notebook", diff --git a/pyatlan_v9/model/assets/_init_partial.py b/pyatlan_v9/model/assets/_init_partial.py index fb90e59ed..d03154c5b 100644 --- a/pyatlan_v9/model/assets/_init_partial.py +++ b/pyatlan_v9/model/assets/_init_partial.py @@ -8,14 +8,10 @@ This module provides convenient imports for all Partial types and their Related variants. """ -from .partial_related import ( - RelatedPartial, - RelatedPartialField, - RelatedPartialObject, -) from .partial import Partial from .partial_field import PartialField from .partial_object import PartialObject +from .partial_related import RelatedPartial, RelatedPartialField, RelatedPartialObject __all__ = [ "Partial", diff --git a/pyatlan_v9/model/assets/_init_power_bi.py b/pyatlan_v9/model/assets/_init_power_bi.py index 2e2dfe261..27fdc9f52 100644 --- a/pyatlan_v9/model/assets/_init_power_bi.py +++ b/pyatlan_v9/model/assets/_init_power_bi.py @@ -8,6 +8,16 @@ This module provides convenient imports for all PowerBI types and their Related variants. """ +from .power_bi import PowerBI +from .power_bi_app import PowerBIApp +from .power_bi_column import PowerBIColumn +from .power_bi_dashboard import PowerBIDashboard +from .power_bi_dataflow import PowerBIDataflow +from .power_bi_dataflow_entity_column import PowerBIDataflowEntityColumn +from .power_bi_dataset import PowerBIDataset +from .power_bi_datasource import PowerBIDatasource +from .power_bi_measure import PowerBIMeasure +from .power_bi_page import PowerBIPage from .power_bi_related import ( RelatedPowerBI, RelatedPowerBIApp, @@ -24,16 +34,6 @@ RelatedPowerBITile, RelatedPowerBIWorkspace, ) -from .power_bi import PowerBI -from .power_bi_app import PowerBIApp -from .power_bi_column import PowerBIColumn -from .power_bi_dashboard import PowerBIDashboard -from .power_bi_dataflow import PowerBIDataflow -from .power_bi_dataflow_entity_column import PowerBIDataflowEntityColumn -from .power_bi_dataset import PowerBIDataset -from .power_bi_datasource import PowerBIDatasource -from .power_bi_measure import PowerBIMeasure -from .power_bi_page import PowerBIPage from .power_bi_report import PowerBIReport from .power_bi_table import PowerBITable from .power_bi_tile import PowerBITile diff --git a/pyatlan_v9/model/assets/_init_preset.py b/pyatlan_v9/model/assets/_init_preset.py index 4d14090b0..58c963aa8 100644 --- a/pyatlan_v9/model/assets/_init_preset.py +++ b/pyatlan_v9/model/assets/_init_preset.py @@ -8,6 +8,10 @@ This module provides convenient imports for all Preset types and their Related variants. """ +from .preset import Preset +from .preset_chart import PresetChart +from .preset_dashboard import PresetDashboard +from .preset_dataset import PresetDataset from .preset_related import ( RelatedPreset, RelatedPresetChart, @@ -15,10 +19,6 @@ RelatedPresetDataset, RelatedPresetWorkspace, ) -from .preset import Preset -from .preset_chart import PresetChart -from .preset_dashboard import PresetDashboard -from .preset_dataset import PresetDataset from .preset_workspace import PresetWorkspace __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_process.py b/pyatlan_v9/model/assets/_init_process.py index 93878a4bf..33e1990b8 100644 --- a/pyatlan_v9/model/assets/_init_process.py +++ b/pyatlan_v9/model/assets/_init_process.py @@ -8,15 +8,15 @@ This module provides convenient imports for all Process types and their Related variants. """ +from .bi_process import BIProcess +from .column_process import ColumnProcess +from .process import Process from .process_related import ( RelatedBIProcess, RelatedColumnProcess, RelatedConnectionProcess, RelatedProcess, ) -from .process import Process -from .bi_process import BIProcess -from .column_process import ColumnProcess __all__ = [ "BIProcess", diff --git a/pyatlan_v9/model/assets/_init_qlik.py b/pyatlan_v9/model/assets/_init_qlik.py index 26ef5438b..cd5f3f8b2 100644 --- a/pyatlan_v9/model/assets/_init_qlik.py +++ b/pyatlan_v9/model/assets/_init_qlik.py @@ -8,6 +8,11 @@ This module provides convenient imports for all Qlik types and their Related variants. """ +from .qlik import Qlik +from .qlik_app import QlikApp +from .qlik_chart import QlikChart +from .qlik_column import QlikColumn +from .qlik_dataset import QlikDataset from .qlik_related import ( RelatedQlik, RelatedQlikApp, @@ -18,11 +23,6 @@ RelatedQlikSpace, RelatedQlikStream, ) -from .qlik import Qlik -from .qlik_app import QlikApp -from .qlik_chart import QlikChart -from .qlik_column import QlikColumn -from .qlik_dataset import QlikDataset from .qlik_sheet import QlikSheet from .qlik_space import QlikSpace diff --git a/pyatlan_v9/model/assets/_init_quick_sight.py b/pyatlan_v9/model/assets/_init_quick_sight.py index 844246682..dd3681535 100644 --- a/pyatlan_v9/model/assets/_init_quick_sight.py +++ b/pyatlan_v9/model/assets/_init_quick_sight.py @@ -8,6 +8,14 @@ This module provides convenient imports for all QuickSight types and their Related variants. """ +from .quick_sight import QuickSight +from .quick_sight_analysis import QuickSightAnalysis +from .quick_sight_analysis_visual import QuickSightAnalysisVisual +from .quick_sight_dashboard import QuickSightDashboard +from .quick_sight_dashboard_visual import QuickSightDashboardVisual +from .quick_sight_dataset import QuickSightDataset +from .quick_sight_dataset_field import QuickSightDatasetField +from .quick_sight_folder import QuickSightFolder from .quick_sight_related import ( RelatedQuickSight, RelatedQuickSightAnalysis, @@ -18,14 +26,6 @@ RelatedQuickSightDatasetField, RelatedQuickSightFolder, ) -from .quick_sight import QuickSight -from .quick_sight_analysis import QuickSightAnalysis -from .quick_sight_analysis_visual import QuickSightAnalysisVisual -from .quick_sight_dashboard import QuickSightDashboard -from .quick_sight_dashboard_visual import QuickSightDashboardVisual -from .quick_sight_dataset import QuickSightDataset -from .quick_sight_dataset_field import QuickSightDatasetField -from .quick_sight_folder import QuickSightFolder __all__ = [ "QuickSight", diff --git a/pyatlan_v9/model/assets/_init_redash.py b/pyatlan_v9/model/assets/_init_redash.py index 489f8eae2..9da32e740 100644 --- a/pyatlan_v9/model/assets/_init_redash.py +++ b/pyatlan_v9/model/assets/_init_redash.py @@ -8,15 +8,15 @@ This module provides convenient imports for all Redash types and their Related variants. """ +from .redash import Redash +from .redash_dashboard import RedashDashboard +from .redash_query import RedashQuery from .redash_related import ( RelatedRedash, RelatedRedashDashboard, RelatedRedashQuery, RelatedRedashVisualization, ) -from .redash import Redash -from .redash_dashboard import RedashDashboard -from .redash_query import RedashQuery from .redash_visualization import RedashVisualization __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_referenceable.py b/pyatlan_v9/model/assets/_init_referenceable.py index 7fe9cf852..1f9819899 100644 --- a/pyatlan_v9/model/assets/_init_referenceable.py +++ b/pyatlan_v9/model/assets/_init_referenceable.py @@ -8,9 +8,9 @@ This module provides convenient imports for all Referenceable types and their Related variants. """ -from .entity import Entity, AtlasClassification, TermAssignment -from .referenceable_related import RelatedReferenceable +from .entity import AtlasClassification, Entity, TermAssignment from .referenceable import Referenceable +from .referenceable_related import RelatedReferenceable __all__ = [ "AtlasClassification", diff --git a/pyatlan_v9/model/assets/_init_resource.py b/pyatlan_v9/model/assets/_init_resource.py index afd9befac..d7e7487ec 100644 --- a/pyatlan_v9/model/assets/_init_resource.py +++ b/pyatlan_v9/model/assets/_init_resource.py @@ -8,20 +8,20 @@ This module provides convenient imports for all Resource types and their Related variants. """ +from .file import File +from .link import Link +from .readme import Readme +from .readme_template import ReadmeTemplate +from .resource import Resource from .resource_related import ( + Related__internal, RelatedBadge, RelatedFile, RelatedLink, RelatedReadme, RelatedReadmeTemplate, RelatedResource, - Related__internal, ) -from .resource import Resource -from .file import File -from .link import Link -from .readme import Readme -from .readme_template import ReadmeTemplate __all__ = [ "File", diff --git a/pyatlan_v9/model/assets/_init_s3.py b/pyatlan_v9/model/assets/_init_s3.py index 1c4800ec7..28c6da21c 100644 --- a/pyatlan_v9/model/assets/_init_s3.py +++ b/pyatlan_v9/model/assets/_init_s3.py @@ -8,16 +8,11 @@ This module provides convenient imports for all S3 types and their Related variants. """ -from .s3_related import ( - RelatedS3, - RelatedS3Bucket, - RelatedS3Object, - RelatedS3Prefix, -) from .s3 import S3 from .s3_bucket import S3Bucket from .s3_object import S3Object from .s3_prefix import S3Prefix +from .s3_related import RelatedS3, RelatedS3Bucket, RelatedS3Object, RelatedS3Prefix __all__ = [ "RelatedS3", diff --git a/pyatlan_v9/model/assets/_init_sage_maker.py b/pyatlan_v9/model/assets/_init_sage_maker.py index 136b334f4..8f2a376ee 100644 --- a/pyatlan_v9/model/assets/_init_sage_maker.py +++ b/pyatlan_v9/model/assets/_init_sage_maker.py @@ -8,6 +8,12 @@ This module provides convenient imports for all SageMaker types and their Related variants. """ +from .sage_maker import SageMaker +from .sage_maker_feature import SageMakerFeature +from .sage_maker_feature_group import SageMakerFeatureGroup +from .sage_maker_model import SageMakerModel +from .sage_maker_model_deployment import SageMakerModelDeployment +from .sage_maker_model_group import SageMakerModelGroup from .sage_maker_related import ( RelatedSageMaker, RelatedSageMakerFeature, @@ -16,12 +22,6 @@ RelatedSageMakerModelDeployment, RelatedSageMakerModelGroup, ) -from .sage_maker import SageMaker -from .sage_maker_feature import SageMakerFeature -from .sage_maker_feature_group import SageMakerFeatureGroup -from .sage_maker_model import SageMakerModel -from .sage_maker_model_deployment import SageMakerModelDeployment -from .sage_maker_model_group import SageMakerModelGroup __all__ = [ "RelatedSageMaker", diff --git a/pyatlan_v9/model/assets/_init_sage_maker_unified_studio.py b/pyatlan_v9/model/assets/_init_sage_maker_unified_studio.py index f14f8da3f..2cecfd1bf 100644 --- a/pyatlan_v9/model/assets/_init_sage_maker_unified_studio.py +++ b/pyatlan_v9/model/assets/_init_sage_maker_unified_studio.py @@ -8,6 +8,13 @@ This module provides convenient imports for all SageMakerUnifiedStudio types and their Related variants. """ +from .sage_maker_unified_studio import SageMakerUnifiedStudio +from .sage_maker_unified_studio_asset import SageMakerUnifiedStudioAsset +from .sage_maker_unified_studio_asset_schema import SageMakerUnifiedStudioAssetSchema +from .sage_maker_unified_studio_project import SageMakerUnifiedStudioProject +from .sage_maker_unified_studio_published_asset import ( + SageMakerUnifiedStudioPublishedAsset, +) from .sage_maker_unified_studio_related import ( RelatedSageMakerUnifiedStudio, RelatedSageMakerUnifiedStudioAsset, @@ -16,13 +23,6 @@ RelatedSageMakerUnifiedStudioPublishedAsset, RelatedSageMakerUnifiedStudioSubscribedAsset, ) -from .sage_maker_unified_studio import SageMakerUnifiedStudio -from .sage_maker_unified_studio_asset import SageMakerUnifiedStudioAsset -from .sage_maker_unified_studio_asset_schema import SageMakerUnifiedStudioAssetSchema -from .sage_maker_unified_studio_project import SageMakerUnifiedStudioProject -from .sage_maker_unified_studio_published_asset import ( - SageMakerUnifiedStudioPublishedAsset, -) from .sage_maker_unified_studio_subscribed_asset import ( SageMakerUnifiedStudioSubscribedAsset, ) diff --git a/pyatlan_v9/model/assets/_init_salesforce.py b/pyatlan_v9/model/assets/_init_salesforce.py index c27552f52..bea9a2412 100644 --- a/pyatlan_v9/model/assets/_init_salesforce.py +++ b/pyatlan_v9/model/assets/_init_salesforce.py @@ -8,6 +8,11 @@ This module provides convenient imports for all Salesforce types and their Related variants. """ +from .salesforce import Salesforce +from .salesforce_dashboard import SalesforceDashboard +from .salesforce_field import SalesforceField +from .salesforce_object import SalesforceObject +from .salesforce_organization import SalesforceOrganization from .salesforce_related import ( RelatedSalesforce, RelatedSalesforceDashboard, @@ -16,11 +21,6 @@ RelatedSalesforceOrganization, RelatedSalesforceReport, ) -from .salesforce import Salesforce -from .salesforce_dashboard import SalesforceDashboard -from .salesforce_field import SalesforceField -from .salesforce_object import SalesforceObject -from .salesforce_organization import SalesforceOrganization from .salesforce_report import SalesforceReport __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_sap.py b/pyatlan_v9/model/assets/_init_sap.py index 65f1bb539..c16ef825f 100644 --- a/pyatlan_v9/model/assets/_init_sap.py +++ b/pyatlan_v9/model/assets/_init_sap.py @@ -8,10 +8,22 @@ This module provides convenient imports for all SAP types and their Related variants. """ +from .sap import SAP +from .sap_column_process import SAPColumnProcess +from .sap_datasphere_replication_flow import SapDatasphereReplicationFlow +from .sap_erp_abap_program import SapErpAbapProgram +from .sap_erp_cds_view import SapErpCdsView +from .sap_erp_column import SapErpColumn +from .sap_erp_component import SapErpComponent +from .sap_erp_fiori_app import SapErpFioriApp +from .sap_erp_function_module import SapErpFunctionModule +from .sap_erp_table import SapErpTable +from .sap_erp_transaction_code import SapErpTransactionCode +from .sap_erp_view import SapErpView +from .sap_process import SAPProcess from .sap_related import ( RelatedSAP, RelatedSAPColumnProcess, - RelatedSAPProcess, RelatedSapDatasphereReplicationFlow, RelatedSapErpAbapProgram, RelatedSapErpCdsView, @@ -22,20 +34,8 @@ RelatedSapErpTable, RelatedSapErpTransactionCode, RelatedSapErpView, + RelatedSAPProcess, ) -from .sap import SAP -from .sap_column_process import SAPColumnProcess -from .sap_datasphere_replication_flow import SapDatasphereReplicationFlow -from .sap_erp_abap_program import SapErpAbapProgram -from .sap_erp_cds_view import SapErpCdsView -from .sap_erp_column import SapErpColumn -from .sap_erp_component import SapErpComponent -from .sap_erp_fiori_app import SapErpFioriApp -from .sap_erp_function_module import SapErpFunctionModule -from .sap_erp_table import SapErpTable -from .sap_erp_transaction_code import SapErpTransactionCode -from .sap_erp_view import SapErpView -from .sap_process import SAPProcess __all__ = [ "RelatedSAP", diff --git a/pyatlan_v9/model/assets/_init_sap_analytics_cloud.py b/pyatlan_v9/model/assets/_init_sap_analytics_cloud.py index a6801d4fa..3e300d611 100644 --- a/pyatlan_v9/model/assets/_init_sap_analytics_cloud.py +++ b/pyatlan_v9/model/assets/_init_sap_analytics_cloud.py @@ -8,6 +8,10 @@ This module provides convenient imports for all SapAnalyticsCloud types and their Related variants. """ +from .sap_analytics_cloud import SapAnalyticsCloud +from .sap_analytics_cloud_column import SapAnalyticsCloudColumn +from .sap_analytics_cloud_folder import SapAnalyticsCloudFolder +from .sap_analytics_cloud_model import SapAnalyticsCloudModel from .sap_analytics_cloud_related import ( RelatedSapAnalyticsCloud, RelatedSapAnalyticsCloudColumn, @@ -15,10 +19,6 @@ RelatedSapAnalyticsCloudModel, RelatedSapAnalyticsCloudStory, ) -from .sap_analytics_cloud import SapAnalyticsCloud -from .sap_analytics_cloud_column import SapAnalyticsCloudColumn -from .sap_analytics_cloud_folder import SapAnalyticsCloudFolder -from .sap_analytics_cloud_model import SapAnalyticsCloudModel from .sap_analytics_cloud_story import SapAnalyticsCloudStory __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_sapbw.py b/pyatlan_v9/model/assets/_init_sapbw.py index f91d579dc..aa13ae182 100644 --- a/pyatlan_v9/model/assets/_init_sapbw.py +++ b/pyatlan_v9/model/assets/_init_sapbw.py @@ -8,15 +8,26 @@ This module provides convenient imports for all SAPBW types and their Related variants. """ +from .sapbw import SAPBW +from .sapbw_composite_provider import SAPBWCompositeProvider +from .sapbw_composite_provider_field import SAPBWCompositeProviderField +from .sapbw_data_source import SAPBWDataSource +from .sapbw_data_source_field import SAPBWDataSourceField +from .sapbw_info_area import SAPBWInfoArea +from .sapbw_info_object import SAPBWInfoObject +from .sapbw_info_source import SAPBWInfoSource +from .sapbw_info_source_field import SAPBWInfoSourceField +from .sapbw_query import SAPBWQuery +from .sapbw_query_element import SAPBWQueryElement from .sapbw_related import ( RelatedSAPBW, RelatedSAPBWADSO, RelatedSAPBWADSOField, RelatedSAPBWCompositeProvider, RelatedSAPBWCompositeProviderField, - RelatedSAPBWDTP, RelatedSAPBWDataSource, RelatedSAPBWDataSourceField, + RelatedSAPBWDTP, RelatedSAPBWInfoArea, RelatedSAPBWInfoObject, RelatedSAPBWInfoSource, @@ -25,17 +36,6 @@ RelatedSAPBWQueryElement, RelatedSAPBWTransformation, ) -from .sapbw import SAPBW -from .sapbw_composite_provider import SAPBWCompositeProvider -from .sapbw_composite_provider_field import SAPBWCompositeProviderField -from .sapbw_data_source import SAPBWDataSource -from .sapbw_data_source_field import SAPBWDataSourceField -from .sapbw_info_area import SAPBWInfoArea -from .sapbw_info_object import SAPBWInfoObject -from .sapbw_info_source import SAPBWInfoSource -from .sapbw_info_source_field import SAPBWInfoSourceField -from .sapbw_query import SAPBWQuery -from .sapbw_query_element import SAPBWQueryElement from .sapbw_transformation import SAPBWTransformation from .sapbwadso import SAPBWADSO from .sapbwadso_field import SAPBWADSOField diff --git a/pyatlan_v9/model/assets/_init_schema_registry.py b/pyatlan_v9/model/assets/_init_schema_registry.py index 43ddfc537..2c8263502 100644 --- a/pyatlan_v9/model/assets/_init_schema_registry.py +++ b/pyatlan_v9/model/assets/_init_schema_registry.py @@ -8,12 +8,12 @@ This module provides convenient imports for all SchemaRegistry types and their Related variants. """ +from .schema_registry import SchemaRegistry from .schema_registry_related import ( RelatedSchemaRegistry, RelatedSchemaRegistrySubject, RelatedSchemaRegistryVersion, ) -from .schema_registry import SchemaRegistry from .schema_registry_subject import SchemaRegistrySubject from .schema_registry_version import SchemaRegistryVersion diff --git a/pyatlan_v9/model/assets/_init_semantic.py b/pyatlan_v9/model/assets/_init_semantic.py index 3ad039cc2..1901a138e 100644 --- a/pyatlan_v9/model/assets/_init_semantic.py +++ b/pyatlan_v9/model/assets/_init_semantic.py @@ -8,6 +8,12 @@ This module provides convenient imports for all Semantic types and their Related variants. """ +from .semantic import Semantic +from .semantic_dimension import SemanticDimension +from .semantic_entity import SemanticEntity +from .semantic_field import SemanticField +from .semantic_measure import SemanticMeasure +from .semantic_model import SemanticModel from .semantic_related import ( RelatedSemantic, RelatedSemanticDimension, @@ -16,12 +22,6 @@ RelatedSemanticMeasure, RelatedSemanticModel, ) -from .semantic import Semantic -from .semantic_dimension import SemanticDimension -from .semantic_entity import SemanticEntity -from .semantic_field import SemanticField -from .semantic_measure import SemanticMeasure -from .semantic_model import SemanticModel __all__ = [ "RelatedSemantic", diff --git a/pyatlan_v9/model/assets/_init_sigma.py b/pyatlan_v9/model/assets/_init_sigma.py index 9388b85f1..5b2e8a1e2 100644 --- a/pyatlan_v9/model/assets/_init_sigma.py +++ b/pyatlan_v9/model/assets/_init_sigma.py @@ -8,6 +8,14 @@ This module provides convenient imports for all Sigma types and their Related variants. """ +from .sigma import Sigma +from .sigma_data_element import SigmaDataElement +from .sigma_data_element_field import SigmaDataElementField +from .sigma_data_model import SigmaDataModel +from .sigma_data_model_column import SigmaDataModelColumn +from .sigma_dataset import SigmaDataset +from .sigma_dataset_column import SigmaDatasetColumn +from .sigma_page import SigmaPage from .sigma_related import ( RelatedSigma, RelatedSigmaDataElement, @@ -19,14 +27,6 @@ RelatedSigmaPage, RelatedSigmaWorkbook, ) -from .sigma import Sigma -from .sigma_data_element import SigmaDataElement -from .sigma_data_element_field import SigmaDataElementField -from .sigma_data_model import SigmaDataModel -from .sigma_data_model_column import SigmaDataModelColumn -from .sigma_dataset import SigmaDataset -from .sigma_dataset_column import SigmaDatasetColumn -from .sigma_page import SigmaPage from .sigma_workbook import SigmaWorkbook __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_sisense.py b/pyatlan_v9/model/assets/_init_sisense.py index efc477a7e..5ecbfc928 100644 --- a/pyatlan_v9/model/assets/_init_sisense.py +++ b/pyatlan_v9/model/assets/_init_sisense.py @@ -8,6 +8,11 @@ This module provides convenient imports for all Sisense types and their Related variants. """ +from .sisense import Sisense +from .sisense_dashboard import SisenseDashboard +from .sisense_datamodel import SisenseDatamodel +from .sisense_datamodel_table import SisenseDatamodelTable +from .sisense_folder import SisenseFolder from .sisense_related import ( RelatedSisense, RelatedSisenseDashboard, @@ -16,11 +21,6 @@ RelatedSisenseFolder, RelatedSisenseWidget, ) -from .sisense import Sisense -from .sisense_dashboard import SisenseDashboard -from .sisense_datamodel import SisenseDatamodel -from .sisense_datamodel_table import SisenseDatamodelTable -from .sisense_folder import SisenseFolder from .sisense_widget import SisenseWidget __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_skill.py b/pyatlan_v9/model/assets/_init_skill.py index 05c1956a0..784cfb23f 100644 --- a/pyatlan_v9/model/assets/_init_skill.py +++ b/pyatlan_v9/model/assets/_init_skill.py @@ -8,8 +8,8 @@ This module provides convenient imports for all Skill types and their Related variants. """ -from .skill_related import RelatedSkill from .skill import Skill +from .skill_related import RelatedSkill __all__ = [ "RelatedSkill", diff --git a/pyatlan_v9/model/assets/_init_skill_artifact.py b/pyatlan_v9/model/assets/_init_skill_artifact.py index 7d9b6b6a7..f7a37b88c 100644 --- a/pyatlan_v9/model/assets/_init_skill_artifact.py +++ b/pyatlan_v9/model/assets/_init_skill_artifact.py @@ -8,8 +8,8 @@ This module provides convenient imports for all SkillArtifact types and their Related variants. """ -from .skill_artifact_related import RelatedSkillArtifact from .skill_artifact import SkillArtifact +from .skill_artifact_related import RelatedSkillArtifact __all__ = [ "RelatedSkillArtifact", diff --git a/pyatlan_v9/model/assets/_init_snowflake.py b/pyatlan_v9/model/assets/_init_snowflake.py index 5a0ca6ccc..a3a4d7068 100644 --- a/pyatlan_v9/model/assets/_init_snowflake.py +++ b/pyatlan_v9/model/assets/_init_snowflake.py @@ -8,6 +8,10 @@ This module provides convenient imports for all Snowflake types and their Related variants. """ +from .snowflake import Snowflake +from .snowflake_ai_model_context import SnowflakeAIModelContext +from .snowflake_ai_model_version import SnowflakeAIModelVersion +from .snowflake_listing import SnowflakeListing from .snowflake_related import ( RelatedSnowflake, RelatedSnowflakeAIModelContext, @@ -25,10 +29,6 @@ RelatedSnowflakeStream, RelatedSnowflakeTag, ) -from .snowflake import Snowflake -from .snowflake_ai_model_context import SnowflakeAIModelContext -from .snowflake_ai_model_version import SnowflakeAIModelVersion -from .snowflake_listing import SnowflakeListing from .snowflake_semantic_dimension import SnowflakeSemanticDimension from .snowflake_semantic_fact import SnowflakeSemanticFact from .snowflake_semantic_logical_table import SnowflakeSemanticLogicalTable diff --git a/pyatlan_v9/model/assets/_init_soda.py b/pyatlan_v9/model/assets/_init_soda.py index 60bcc499c..c65f05c98 100644 --- a/pyatlan_v9/model/assets/_init_soda.py +++ b/pyatlan_v9/model/assets/_init_soda.py @@ -8,12 +8,9 @@ This module provides convenient imports for all Soda types and their Related variants. """ -from .soda_related import ( - RelatedSoda, - RelatedSodaCheck, -) from .soda import Soda from .soda_check import SodaCheck +from .soda_related import RelatedSoda, RelatedSodaCheck __all__ = [ "RelatedSoda", diff --git a/pyatlan_v9/model/assets/_init_spark.py b/pyatlan_v9/model/assets/_init_spark.py index 76aa5d940..43d34411e 100644 --- a/pyatlan_v9/model/assets/_init_spark.py +++ b/pyatlan_v9/model/assets/_init_spark.py @@ -8,12 +8,9 @@ This module provides convenient imports for all Spark types and their Related variants. """ -from .spark_related import ( - RelatedSpark, - RelatedSparkJob, -) from .spark import Spark from .spark_job import SparkJob +from .spark_related import RelatedSpark, RelatedSparkJob __all__ = [ "RelatedSpark", diff --git a/pyatlan_v9/model/assets/_init_sql.py b/pyatlan_v9/model/assets/_init_sql.py index 54db192a6..a5893abd7 100644 --- a/pyatlan_v9/model/assets/_init_sql.py +++ b/pyatlan_v9/model/assets/_init_sql.py @@ -8,6 +8,15 @@ This module provides convenient imports for all SQL types and their Related variants. """ +from .calculation_view import CalculationView +from .column import Column +from .database import Database +from .function import Function +from .materialised_view import MaterialisedView +from .procedure import Procedure +from .query import Query +from .schema import Schema +from .sql import SQL from .sql_related import ( RelatedCalculationView, RelatedColumn, @@ -16,21 +25,12 @@ RelatedMaterialisedView, RelatedProcedure, RelatedQuery, - RelatedSQL, RelatedSchema, + RelatedSQL, RelatedTable, RelatedTablePartition, RelatedView, ) -from .sql import SQL -from .calculation_view import CalculationView -from .column import Column -from .database import Database -from .function import Function -from .materialised_view import MaterialisedView -from .procedure import Procedure -from .query import Query -from .schema import Schema from .table import Table from .table_partition import TablePartition from .view import View diff --git a/pyatlan_v9/model/assets/_init_sql_insight.py b/pyatlan_v9/model/assets/_init_sql_insight.py index febf7dbde..caf9c14b1 100644 --- a/pyatlan_v9/model/assets/_init_sql_insight.py +++ b/pyatlan_v9/model/assets/_init_sql_insight.py @@ -8,16 +8,16 @@ This module provides convenient imports for all SqlInsight types and their Related variants. """ +from .sql_insight import SqlInsight +from .sql_insight_business_question import SqlInsightBusinessQuestion +from .sql_insight_filter import SqlInsightFilter +from .sql_insight_join import SqlInsightJoin from .sql_insight_related import ( RelatedSqlInsight, RelatedSqlInsightBusinessQuestion, RelatedSqlInsightFilter, RelatedSqlInsightJoin, ) -from .sql_insight import SqlInsight -from .sql_insight_business_question import SqlInsightBusinessQuestion -from .sql_insight_filter import SqlInsightFilter -from .sql_insight_join import SqlInsightJoin __all__ = [ "RelatedSqlInsight", diff --git a/pyatlan_v9/model/assets/_init_ssrs.py b/pyatlan_v9/model/assets/_init_ssrs.py index cd72ca5df..b8eed127b 100644 --- a/pyatlan_v9/model/assets/_init_ssrs.py +++ b/pyatlan_v9/model/assets/_init_ssrs.py @@ -8,6 +8,10 @@ This module provides convenient imports for all SSRS types and their Related variants. """ +from .ssrs import SSRS +from .ssrs_data_set import SSRSDataSet +from .ssrs_field import SSRSField +from .ssrs_folder import SSRSFolder from .ssrs_related import ( RelatedSSRS, RelatedSSRSDataSet, @@ -15,10 +19,6 @@ RelatedSSRSFolder, RelatedSSRSReport, ) -from .ssrs import SSRS -from .ssrs_data_set import SSRSDataSet -from .ssrs_field import SSRSField -from .ssrs_folder import SSRSFolder from .ssrs_report import SSRSReport __all__ = [ diff --git a/pyatlan_v9/model/assets/_init_starburst.py b/pyatlan_v9/model/assets/_init_starburst.py index 0579647e2..c82c7d595 100644 --- a/pyatlan_v9/model/assets/_init_starburst.py +++ b/pyatlan_v9/model/assets/_init_starburst.py @@ -8,14 +8,14 @@ This module provides convenient imports for all Starburst types and their Related variants. """ +from .starburst import Starburst +from .starburst_dataset import StarburstDataset +from .starburst_dataset_column import StarburstDatasetColumn from .starburst_related import ( RelatedStarburst, RelatedStarburstDataset, RelatedStarburstDatasetColumn, ) -from .starburst import Starburst -from .starburst_dataset import StarburstDataset -from .starburst_dataset_column import StarburstDatasetColumn __all__ = [ "RelatedStarburst", diff --git a/pyatlan_v9/model/assets/_init_superset.py b/pyatlan_v9/model/assets/_init_superset.py index bf023fa38..85983b7e8 100644 --- a/pyatlan_v9/model/assets/_init_superset.py +++ b/pyatlan_v9/model/assets/_init_superset.py @@ -8,16 +8,16 @@ This module provides convenient imports for all Superset types and their Related variants. """ +from .superset import Superset +from .superset_chart import SupersetChart +from .superset_dashboard import SupersetDashboard +from .superset_dataset import SupersetDataset from .superset_related import ( RelatedSuperset, RelatedSupersetChart, RelatedSupersetDashboard, RelatedSupersetDataset, ) -from .superset import Superset -from .superset_chart import SupersetChart -from .superset_dashboard import SupersetDashboard -from .superset_dataset import SupersetDataset __all__ = [ "RelatedSuperset", diff --git a/pyatlan_v9/model/assets/_init_tableau.py b/pyatlan_v9/model/assets/_init_tableau.py index bf172b445..a9c86dc83 100644 --- a/pyatlan_v9/model/assets/_init_tableau.py +++ b/pyatlan_v9/model/assets/_init_tableau.py @@ -8,6 +8,15 @@ This module provides convenient imports for all Tableau types and their Related variants. """ +from .tableau import Tableau +from .tableau_calculated_field import TableauCalculatedField +from .tableau_dashboard import TableauDashboard +from .tableau_dashboard_field import TableauDashboardField +from .tableau_datasource import TableauDatasource +from .tableau_datasource_field import TableauDatasourceField +from .tableau_flow import TableauFlow +from .tableau_metric import TableauMetric +from .tableau_project import TableauProject from .tableau_related import ( RelatedTableau, RelatedTableauCalculatedField, @@ -23,15 +32,6 @@ RelatedTableauWorksheet, RelatedTableauWorksheetField, ) -from .tableau import Tableau -from .tableau_calculated_field import TableauCalculatedField -from .tableau_dashboard import TableauDashboard -from .tableau_dashboard_field import TableauDashboardField -from .tableau_datasource import TableauDatasource -from .tableau_datasource_field import TableauDatasourceField -from .tableau_flow import TableauFlow -from .tableau_metric import TableauMetric -from .tableau_project import TableauProject from .tableau_site import TableauSite from .tableau_workbook import TableauWorkbook from .tableau_worksheet import TableauWorksheet diff --git a/pyatlan_v9/model/assets/_init_tag.py b/pyatlan_v9/model/assets/_init_tag.py index 8fdefd194..e18f75f38 100644 --- a/pyatlan_v9/model/assets/_init_tag.py +++ b/pyatlan_v9/model/assets/_init_tag.py @@ -8,13 +8,9 @@ This module provides convenient imports for all Tag types and their Related variants. """ -from .tag_related import ( - RelatedSourceTag, - RelatedTag, - RelatedTagAttachment, -) -from .tag import Tag from .source_tag import SourceTag +from .tag import Tag +from .tag_related import RelatedSourceTag, RelatedTag, RelatedTagAttachment __all__ = [ "RelatedSourceTag", diff --git a/pyatlan_v9/model/assets/_init_task.py b/pyatlan_v9/model/assets/_init_task.py index 70a6a7c43..dcab2247f 100644 --- a/pyatlan_v9/model/assets/_init_task.py +++ b/pyatlan_v9/model/assets/_init_task.py @@ -8,8 +8,8 @@ This module provides convenient imports for all Task types and their Related variants. """ -from .task_related import RelatedTask from .task import Task +from .task_related import RelatedTask __all__ = [ "RelatedTask", diff --git a/pyatlan_v9/model/assets/_init_thoughtspot.py b/pyatlan_v9/model/assets/_init_thoughtspot.py index 245c87e3f..c29f1a52f 100644 --- a/pyatlan_v9/model/assets/_init_thoughtspot.py +++ b/pyatlan_v9/model/assets/_init_thoughtspot.py @@ -8,6 +8,11 @@ This module provides convenient imports for all Thoughtspot types and their Related variants. """ +from .thoughtspot import Thoughtspot +from .thoughtspot_answer import ThoughtspotAnswer +from .thoughtspot_column import ThoughtspotColumn +from .thoughtspot_dashlet import ThoughtspotDashlet +from .thoughtspot_liveboard import ThoughtspotLiveboard from .thoughtspot_related import ( RelatedThoughtspot, RelatedThoughtspotAnswer, @@ -18,11 +23,6 @@ RelatedThoughtspotView, RelatedThoughtspotWorksheet, ) -from .thoughtspot import Thoughtspot -from .thoughtspot_answer import ThoughtspotAnswer -from .thoughtspot_column import ThoughtspotColumn -from .thoughtspot_dashlet import ThoughtspotDashlet -from .thoughtspot_liveboard import ThoughtspotLiveboard from .thoughtspot_table import ThoughtspotTable from .thoughtspot_view import ThoughtspotView from .thoughtspot_worksheet import ThoughtspotWorksheet diff --git a/pyatlan_v9/model/assets/_init_unstructured.py b/pyatlan_v9/model/assets/_init_unstructured.py index e6951d666..7abf1f140 100644 --- a/pyatlan_v9/model/assets/_init_unstructured.py +++ b/pyatlan_v9/model/assets/_init_unstructured.py @@ -8,16 +8,16 @@ This module provides convenient imports for all Unstructured types and their Related variants. """ +from .unstructured import Unstructured +from .unstructured_container import UnstructuredContainer +from .unstructured_folder import UnstructuredFolder +from .unstructured_object import UnstructuredObject from .unstructured_related import ( RelatedUnstructured, RelatedUnstructuredContainer, RelatedUnstructuredFolder, RelatedUnstructuredObject, ) -from .unstructured import Unstructured -from .unstructured_container import UnstructuredContainer -from .unstructured_folder import UnstructuredFolder -from .unstructured_object import UnstructuredObject __all__ = [ "RelatedUnstructured", diff --git a/pyatlan_v9/model/assets/_init_workflow.py b/pyatlan_v9/model/assets/_init_workflow.py index 81e8a1c0e..a83814794 100644 --- a/pyatlan_v9/model/assets/_init_workflow.py +++ b/pyatlan_v9/model/assets/_init_workflow.py @@ -8,11 +8,8 @@ This module provides convenient imports for all Workflow types and their Related variants. """ -from .workflow_related import ( - RelatedWorkflow, - RelatedWorkflowRun, -) from .workflow import Workflow +from .workflow_related import RelatedWorkflow, RelatedWorkflowRun __all__ = [ "RelatedWorkflow", diff --git a/pyatlan_v9/model/assets/access_control.py b/pyatlan_v9/model/assets/access_control.py index b5dfb3390..6800384a5 100644 --- a/pyatlan_v9/model/assets/access_control.py +++ b/pyatlan_v9/model/assets/access_control.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .access_control_related import RelatedAccessControl, RelatedAuthPolicy from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -41,14 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .access_control_related import RelatedAccessControl, RelatedAuthPolicy # ============================================================================= # FLAT ASSET CLASS @@ -587,33 +587,36 @@ def _access_control_from_nested(nested: AccessControlNested) -> AccessControl: _ACCESS_CONTROL_REL_FIELDS, AccessControlRelationshipAttributes, ) - return AccessControl( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_access_control_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_access_control_attrs(attrs)) + kwargs.update(merged_rels) + return AccessControl(**kwargs) def _access_control_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/adf.py b/pyatlan_v9/model/assets/adf.py index c58c6fd4e..f862ffe00 100644 --- a/pyatlan_v9/model/assets/adf.py +++ b/pyatlan_v9/model/assets/adf.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .adf_related import RelatedADF from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .adf_related import RelatedADF # ============================================================================= # FLAT ASSET CLASS @@ -584,33 +584,36 @@ def _adf_from_nested(nested: ADFNested) -> ADF: _ADF_REL_FIELDS, ADFRelationshipAttributes, ) - return ADF( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_adf_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_adf_attrs(attrs)) + kwargs.update(merged_rels) + return ADF(**kwargs) def _adf_to_nested_bytes(adf: ADF, serde: Serde) -> bytes: @@ -627,10 +630,7 @@ def _adf_from_nested_bytes(data: bytes, serde: Serde) -> ADF: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 ADF.ADF_FACTORY_NAME = KeywordField("adfFactoryName", "adfFactoryName") ADF.ADF_ASSET_FOLDER_PATH = KeywordField("adfAssetFolderPath", "adfAssetFolderPath") diff --git a/pyatlan_v9/model/assets/adf_activity.py b/pyatlan_v9/model/assets/adf_activity.py index ac7c9ada6..1080ff942 100644 --- a/pyatlan_v9/model/assets/adf_activity.py +++ b/pyatlan_v9/model/assets/adf_activity.py @@ -19,6 +19,20 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .adf_related import ( + RelatedAdfActivity, + RelatedAdfDataflow, + RelatedAdfDataset, + RelatedAdfLinkedservice, + RelatedAdfPipeline, +) from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,20 +61,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .adf_related import ( - RelatedAdfActivity, - RelatedAdfDataflow, - RelatedAdfDataset, - RelatedAdfLinkedservice, - RelatedAdfPipeline, -) # ============================================================================= # FLAT ASSET CLASS @@ -828,33 +828,36 @@ def _adf_activity_from_nested(nested: AdfActivityNested) -> AdfActivity: _ADF_ACTIVITY_REL_FIELDS, AdfActivityRelationshipAttributes, ) - return AdfActivity( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_adf_activity_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_adf_activity_attrs(attrs)) + kwargs.update(merged_rels) + return AdfActivity(**kwargs) def _adf_activity_to_nested_bytes(adf_activity: AdfActivity, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/adf_dataflow.py b/pyatlan_v9/model/assets/adf_dataflow.py index 102d91469..be921981d 100644 --- a/pyatlan_v9/model/assets/adf_dataflow.py +++ b/pyatlan_v9/model/assets/adf_dataflow.py @@ -18,6 +18,20 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .adf_related import ( + RelatedAdfActivity, + RelatedAdfDataflow, + RelatedAdfDataset, + RelatedAdfLinkedservice, + RelatedAdfPipeline, +) from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,20 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .adf_related import ( - RelatedAdfActivity, - RelatedAdfDataflow, - RelatedAdfDataset, - RelatedAdfLinkedservice, - RelatedAdfPipeline, -) # ============================================================================= # FLAT ASSET CLASS @@ -657,33 +657,36 @@ def _adf_dataflow_from_nested(nested: AdfDataflowNested) -> AdfDataflow: _ADF_DATAFLOW_REL_FIELDS, AdfDataflowRelationshipAttributes, ) - return AdfDataflow( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_adf_dataflow_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_adf_dataflow_attrs(attrs)) + kwargs.update(merged_rels) + return AdfDataflow(**kwargs) def _adf_dataflow_to_nested_bytes(adf_dataflow: AdfDataflow, serde: Serde) -> bytes: @@ -700,10 +703,7 @@ def _adf_dataflow_from_nested_bytes(data: bytes, serde: Serde) -> AdfDataflow: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AdfDataflow.ADF_DATAFLOW_SOURCES = KeywordField( "adfDataflowSources", "adfDataflowSources" diff --git a/pyatlan_v9/model/assets/adf_dataset.py b/pyatlan_v9/model/assets/adf_dataset.py index 7fa7c3e14..4e20ebef3 100644 --- a/pyatlan_v9/model/assets/adf_dataset.py +++ b/pyatlan_v9/model/assets/adf_dataset.py @@ -18,6 +18,20 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .adf_related import ( + RelatedAdfActivity, + RelatedAdfDataflow, + RelatedAdfDataset, + RelatedAdfLinkedservice, + RelatedAdfPipeline, +) from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,20 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .adf_related import ( - RelatedAdfActivity, - RelatedAdfDataflow, - RelatedAdfDataset, - RelatedAdfLinkedservice, - RelatedAdfPipeline, -) # ============================================================================= # FLAT ASSET CLASS @@ -727,33 +727,36 @@ def _adf_dataset_from_nested(nested: AdfDatasetNested) -> AdfDataset: _ADF_DATASET_REL_FIELDS, AdfDatasetRelationshipAttributes, ) - return AdfDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_adf_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_adf_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return AdfDataset(**kwargs) def _adf_dataset_to_nested_bytes(adf_dataset: AdfDataset, serde: Serde) -> bytes: @@ -770,10 +773,7 @@ def _adf_dataset_from_nested_bytes(data: bytes, serde: Serde) -> AdfDataset: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AdfDataset.ADF_DATASET_TYPE = KeywordField("adfDatasetType", "adfDatasetType") AdfDataset.ADF_DATASET_ANNOTATIONS = KeywordField( diff --git a/pyatlan_v9/model/assets/adf_linkedservice.py b/pyatlan_v9/model/assets/adf_linkedservice.py index 36ff1f729..1b7c14d24 100644 --- a/pyatlan_v9/model/assets/adf_linkedservice.py +++ b/pyatlan_v9/model/assets/adf_linkedservice.py @@ -18,6 +18,20 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .adf_related import ( + RelatedAdfActivity, + RelatedAdfDataflow, + RelatedAdfDataset, + RelatedAdfLinkedservice, + RelatedAdfPipeline, +) from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,20 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .adf_related import ( - RelatedAdfActivity, - RelatedAdfDataflow, - RelatedAdfDataset, - RelatedAdfLinkedservice, - RelatedAdfPipeline, -) # ============================================================================= # FLAT ASSET CLASS @@ -781,33 +781,36 @@ def _adf_linkedservice_from_nested(nested: AdfLinkedserviceNested) -> AdfLinkeds _ADF_LINKEDSERVICE_REL_FIELDS, AdfLinkedserviceRelationshipAttributes, ) - return AdfLinkedservice( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_adf_linkedservice_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_adf_linkedservice_attrs(attrs)) + kwargs.update(merged_rels) + return AdfLinkedservice(**kwargs) def _adf_linkedservice_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/adf_pipeline.py b/pyatlan_v9/model/assets/adf_pipeline.py index 86fa64d96..d7665f4cd 100644 --- a/pyatlan_v9/model/assets/adf_pipeline.py +++ b/pyatlan_v9/model/assets/adf_pipeline.py @@ -18,6 +18,20 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .adf_related import ( + RelatedAdfActivity, + RelatedAdfDataflow, + RelatedAdfDataset, + RelatedAdfLinkedservice, + RelatedAdfPipeline, +) from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,20 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .adf_related import ( - RelatedAdfActivity, - RelatedAdfDataflow, - RelatedAdfDataset, - RelatedAdfLinkedservice, - RelatedAdfPipeline, -) # ============================================================================= # FLAT ASSET CLASS @@ -657,33 +657,36 @@ def _adf_pipeline_from_nested(nested: AdfPipelineNested) -> AdfPipeline: _ADF_PIPELINE_REL_FIELDS, AdfPipelineRelationshipAttributes, ) - return AdfPipeline( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_adf_pipeline_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_adf_pipeline_attrs(attrs)) + kwargs.update(merged_rels) + return AdfPipeline(**kwargs) def _adf_pipeline_to_nested_bytes(adf_pipeline: AdfPipeline, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/adls.py b/pyatlan_v9/model/assets/adls.py index 8d26cf9f6..65bd9c24c 100644 --- a/pyatlan_v9/model/assets/adls.py +++ b/pyatlan_v9/model/assets/adls.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .adls_related import RelatedADLS from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .adls_related import RelatedADLS # ============================================================================= # FLAT ASSET CLASS @@ -629,33 +629,36 @@ def _adls_from_nested(nested: ADLSNested) -> ADLS: _ADLS_REL_FIELDS, ADLSRelationshipAttributes, ) - return ADLS( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_adls_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_adls_attrs(attrs)) + kwargs.update(merged_rels) + return ADLS(**kwargs) def _adls_to_nested_bytes(adls: ADLS, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/adls_account.py b/pyatlan_v9/model/assets/adls_account.py index 4e3e81f84..55eb09264 100644 --- a/pyatlan_v9/model/assets/adls_account.py +++ b/pyatlan_v9/model/assets/adls_account.py @@ -19,6 +19,15 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + +from .adls_related import RelatedADLSAccount, RelatedADLSContainer from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,15 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .adls_related import RelatedADLSAccount, RelatedADLSContainer # ============================================================================= # FLAT ASSET CLASS @@ -773,33 +773,36 @@ def _adls_account_from_nested(nested: ADLSAccountNested) -> ADLSAccount: _ADLS_ACCOUNT_REL_FIELDS, ADLSAccountRelationshipAttributes, ) - return ADLSAccount( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_adls_account_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_adls_account_attrs(attrs)) + kwargs.update(merged_rels) + return ADLSAccount(**kwargs) def _adls_account_to_nested_bytes(adls_account: ADLSAccount, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/adls_container.py b/pyatlan_v9/model/assets/adls_container.py index 7b3974b35..1a1add00f 100644 --- a/pyatlan_v9/model/assets/adls_container.py +++ b/pyatlan_v9/model/assets/adls_container.py @@ -19,6 +19,15 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + +from .adls_related import RelatedADLSAccount, RelatedADLSContainer, RelatedADLSObject from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,15 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .adls_related import RelatedADLSAccount, RelatedADLSContainer, RelatedADLSObject # ============================================================================= # FLAT ASSET CLASS @@ -783,33 +783,36 @@ def _adls_container_from_nested(nested: ADLSContainerNested) -> ADLSContainer: _ADLS_CONTAINER_REL_FIELDS, ADLSContainerRelationshipAttributes, ) - return ADLSContainer( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_adls_container_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_adls_container_attrs(attrs)) + kwargs.update(merged_rels) + return ADLSContainer(**kwargs) def _adls_container_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/adls_object.py b/pyatlan_v9/model/assets/adls_object.py index 5fc86efa2..647ed19e8 100644 --- a/pyatlan_v9/model/assets/adls_object.py +++ b/pyatlan_v9/model/assets/adls_object.py @@ -20,6 +20,16 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan.model.utils import construct_object_key +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + +from .adls_related import RelatedADLSContainer, RelatedADLSObject from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -48,16 +58,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.utils import construct_object_key -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .adls_related import RelatedADLSContainer, RelatedADLSObject # ============================================================================= # FLAT ASSET CLASS @@ -964,33 +964,36 @@ def _adls_object_from_nested(nested: ADLSObjectNested) -> ADLSObject: _ADLS_OBJECT_REL_FIELDS, ADLSObjectRelationshipAttributes, ) - return ADLSObject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_adls_object_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_adls_object_attrs(attrs)) + kwargs.update(merged_rels) + return ADLSObject(**kwargs) def _adls_object_to_nested_bytes(adls_object: ADLSObject, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/agent.py b/pyatlan_v9/model/assets/agent.py index 270336956..34c1f9d38 100644 --- a/pyatlan_v9/model/assets/agent.py +++ b/pyatlan_v9/model/assets/agent.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .agent_related import RelatedAgent from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,14 +55,6 @@ from .skill_related import RelatedSkill from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .agent_related import RelatedAgent # ============================================================================= # FLAT ASSET CLASS @@ -686,33 +686,36 @@ def _agent_from_nested(nested: AgentNested) -> Agent: _AGENT_REL_FIELDS, AgentRelationshipAttributes, ) - return Agent( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_agent_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_agent_attrs(attrs)) + kwargs.update(merged_rels) + return Agent(**kwargs) def _agent_to_nested_bytes(agent: Agent, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/agentic.py b/pyatlan_v9/model/assets/agentic.py index 38d71fc8f..e7fefe329 100644 --- a/pyatlan_v9/model/assets/agentic.py +++ b/pyatlan_v9/model/assets/agentic.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .agentic_related import RelatedAgentic from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .agentic_related import RelatedAgentic # ============================================================================= # FLAT ASSET CLASS @@ -588,33 +588,36 @@ def _agentic_from_nested(nested: AgenticNested) -> Agentic: _AGENTIC_REL_FIELDS, AgenticRelationshipAttributes, ) - return Agentic( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_agentic_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_agentic_attrs(attrs)) + kwargs.update(merged_rels) + return Agentic(**kwargs) def _agentic_to_nested_bytes(agentic: Agentic, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/ai.py b/pyatlan_v9/model/assets/ai.py index 3009427f7..b9f9cacc4 100644 --- a/pyatlan_v9/model/assets/ai.py +++ b/pyatlan_v9/model/assets/ai.py @@ -19,6 +19,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .ai_related import RelatedAI from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .ai_related import RelatedAI # ============================================================================= # FLAT ASSET CLASS @@ -668,33 +668,36 @@ def _ai_from_nested(nested: AINested) -> AI: _AI_REL_FIELDS, AIRelationshipAttributes, ) - return AI( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_ai_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_ai_attrs(attrs)) + kwargs.update(merged_rels) + return AI(**kwargs) def _ai_to_nested_bytes(ai: AI, serde: Serde) -> bytes: @@ -711,10 +714,7 @@ def _ai_from_nested_bytes(data: bytes, serde: Serde) -> AI: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AI.ETHICAL_AI_PRIVACY_CONFIG = KeywordField( "ethicalAIPrivacyConfig", "ethicalAIPrivacyConfig" diff --git a/pyatlan_v9/model/assets/ai_application.py b/pyatlan_v9/model/assets/ai_application.py index bb76bfc8e..72879595c 100644 --- a/pyatlan_v9/model/assets/ai_application.py +++ b/pyatlan_v9/model/assets/ai_application.py @@ -19,6 +19,17 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AtlanConnectorType +from pyatlan.utils import to_camel_case +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + +from .ai_related import RelatedAIApplication, RelatedAIModel from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,17 +58,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.enums import AtlanConnectorType -from pyatlan.utils import to_camel_case -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .ai_related import RelatedAIApplication, RelatedAIModel # ============================================================================= # FLAT ASSET CLASS @@ -746,33 +746,36 @@ def _ai_application_from_nested(nested: AIApplicationNested) -> AIApplication: _AI_APPLICATION_REL_FIELDS, AIApplicationRelationshipAttributes, ) - return AIApplication( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_ai_application_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_ai_application_attrs(attrs)) + kwargs.update(merged_rels) + return AIApplication(**kwargs) def _ai_application_to_nested_bytes( @@ -791,10 +794,7 @@ def _ai_application_from_nested_bytes(data: bytes, serde: Serde) -> AIApplicatio # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AIApplication.AI_APPLICATION_VERSION = KeywordField( "aiApplicationVersion", "aiApplicationVersion" diff --git a/pyatlan_v9/model/assets/ai_model.py b/pyatlan_v9/model/assets/ai_model.py index 5305be232..0406271ea 100644 --- a/pyatlan_v9/model/assets/ai_model.py +++ b/pyatlan_v9/model/assets/ai_model.py @@ -19,6 +19,18 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AIDatasetType, AtlanConnectorType +from pyatlan.utils import to_camel_case +from pyatlan_v9.model.assets.process import Process +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import get_type, register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + +from .ai_related import RelatedAIApplication, RelatedAIModel, RelatedAIModelVersion from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,19 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.enums import AIDatasetType, AtlanConnectorType -from pyatlan.utils import to_camel_case -from pyatlan_v9.model.assets.process import Process -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import get_type -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .ai_related import RelatedAIApplication, RelatedAIModel, RelatedAIModelVersion # ============================================================================= # FLAT ASSET CLASS @@ -818,33 +817,36 @@ def _ai_model_from_nested(nested: AIModelNested) -> AIModel: _AI_MODEL_REL_FIELDS, AIModelRelationshipAttributes, ) - return AIModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_ai_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_ai_model_attrs(attrs)) + kwargs.update(merged_rels) + return AIModel(**kwargs) def _ai_model_to_nested_bytes(ai_model: AIModel, serde: Serde) -> bytes: @@ -861,10 +863,7 @@ def _ai_model_from_nested_bytes(data: bytes, serde: Serde) -> AIModel: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AIModel.AI_MODEL_DATASETS_DSL = KeywordField("aiModelDatasetsDSL", "aiModelDatasetsDSL") AIModel.AI_MODEL_STATUS = KeywordField("aiModelStatus", "aiModelStatus") diff --git a/pyatlan_v9/model/assets/ai_model_version.py b/pyatlan_v9/model/assets/ai_model_version.py index 953742e85..fddabc7ef 100644 --- a/pyatlan_v9/model/assets/ai_model_version.py +++ b/pyatlan_v9/model/assets/ai_model_version.py @@ -20,6 +20,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .ai_related import RelatedAIModel, RelatedAIModelVersion from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -48,14 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .ai_related import RelatedAIModel, RelatedAIModelVersion # ============================================================================= # FLAT ASSET CLASS @@ -734,33 +734,36 @@ def _ai_model_version_from_nested(nested: AIModelVersionNested) -> AIModelVersio _AI_MODEL_VERSION_REL_FIELDS, AIModelVersionRelationshipAttributes, ) - return AIModelVersion( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_ai_model_version_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_ai_model_version_attrs(attrs)) + kwargs.update(merged_rels) + return AIModelVersion(**kwargs) def _ai_model_version_to_nested_bytes( @@ -779,10 +782,7 @@ def _ai_model_version_from_nested_bytes(data: bytes, serde: Serde) -> AIModelVer # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AIModelVersion.AI_MODEL_QUALIFIED_NAME = KeywordField( "aiModelQualifiedName", "aiModelQualifiedName" diff --git a/pyatlan_v9/model/assets/airflow.py b/pyatlan_v9/model/assets/airflow.py index f7d6b26f4..3296e7e11 100644 --- a/pyatlan_v9/model/assets/airflow.py +++ b/pyatlan_v9/model/assets/airflow.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .airflow_related import RelatedAirflow, RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -45,14 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSpark, RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .airflow_related import RelatedAirflow, RelatedAirflowTask # ============================================================================= # FLAT ASSET CLASS @@ -658,33 +658,36 @@ def _airflow_from_nested(nested: AirflowNested) -> Airflow: _AIRFLOW_REL_FIELDS, AirflowRelationshipAttributes, ) - return Airflow( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_airflow_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_airflow_attrs(attrs)) + kwargs.update(merged_rels) + return Airflow(**kwargs) def _airflow_to_nested_bytes(airflow: Airflow, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/airflow_dag.py b/pyatlan_v9/model/assets/airflow_dag.py index 46d9aed53..dcc3d541b 100644 --- a/pyatlan_v9/model/assets/airflow_dag.py +++ b/pyatlan_v9/model/assets/airflow_dag.py @@ -18,6 +18,15 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + +from .airflow_related import RelatedAirflowDag, RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -45,15 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSpark, RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .airflow_related import RelatedAirflowDag, RelatedAirflowTask # ============================================================================= # FLAT ASSET CLASS @@ -717,33 +717,36 @@ def _airflow_dag_from_nested(nested: AirflowDagNested) -> AirflowDag: _AIRFLOW_DAG_REL_FIELDS, AirflowDagRelationshipAttributes, ) - return AirflowDag( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_airflow_dag_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_airflow_dag_attrs(attrs)) + kwargs.update(merged_rels) + return AirflowDag(**kwargs) def _airflow_dag_to_nested_bytes(airflow_dag: AirflowDag, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/airflow_task.py b/pyatlan_v9/model/assets/airflow_task.py index 0e328cc12..fe2a56746 100644 --- a/pyatlan_v9/model/assets/airflow_task.py +++ b/pyatlan_v9/model/assets/airflow_task.py @@ -19,6 +19,15 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + +from .airflow_related import RelatedAirflowDag, RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -47,15 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSpark, RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .airflow_related import RelatedAirflowDag, RelatedAirflowTask # ============================================================================= # FLAT ASSET CLASS @@ -857,33 +857,36 @@ def _airflow_task_from_nested(nested: AirflowTaskNested) -> AirflowTask: _AIRFLOW_TASK_REL_FIELDS, AirflowTaskRelationshipAttributes, ) - return AirflowTask( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_airflow_task_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_airflow_task_attrs(attrs)) + kwargs.update(merged_rels) + return AirflowTask(**kwargs) def _airflow_task_to_nested_bytes(airflow_task: AirflowTask, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/anaplan.py b/pyatlan_v9/model/assets/anaplan.py index 7c33d7a02..00fea62f5 100644 --- a/pyatlan_v9/model/assets/anaplan.py +++ b/pyatlan_v9/model/assets/anaplan.py @@ -18,7 +18,15 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask +from .anaplan_related import RelatedAnaplan from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .anaplan_related import RelatedAnaplan # ============================================================================= # FLAT ASSET CLASS @@ -633,33 +633,36 @@ def _anaplan_from_nested(nested: AnaplanNested) -> Anaplan: _ANAPLAN_REL_FIELDS, AnaplanRelationshipAttributes, ) - return Anaplan( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_attrs(attrs)) + kwargs.update(merged_rels) + return Anaplan(**kwargs) def _anaplan_to_nested_bytes(anaplan: Anaplan, serde: Serde) -> bytes: @@ -676,10 +679,7 @@ def _anaplan_from_nested_bytes(data: bytes, serde: Serde) -> Anaplan: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Anaplan.ANAPLAN_WORKSPACE_QUALIFIED_NAME = KeywordField( "anaplanWorkspaceQualifiedName", "anaplanWorkspaceQualifiedName" diff --git a/pyatlan_v9/model/assets/anaplan_app.py b/pyatlan_v9/model/assets/anaplan_app.py index 9a8e46b58..9008ab6bf 100644 --- a/pyatlan_v9/model/assets/anaplan_app.py +++ b/pyatlan_v9/model/assets/anaplan_app.py @@ -18,7 +18,16 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask +from .anaplan_related import RelatedAnaplanApp, RelatedAnaplanPage from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -46,15 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .anaplan_related import RelatedAnaplanApp, RelatedAnaplanPage # ============================================================================= # FLAT ASSET CLASS @@ -670,33 +670,36 @@ def _anaplan_app_from_nested(nested: AnaplanAppNested) -> AnaplanApp: _ANAPLAN_APP_REL_FIELDS, AnaplanAppRelationshipAttributes, ) - return AnaplanApp( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_app_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_app_attrs(attrs)) + kwargs.update(merged_rels) + return AnaplanApp(**kwargs) def _anaplan_app_to_nested_bytes(anaplan_app: AnaplanApp, serde: Serde) -> bytes: @@ -713,10 +716,7 @@ def _anaplan_app_from_nested_bytes(data: bytes, serde: Serde) -> AnaplanApp: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AnaplanApp.ANAPLAN_WORKSPACE_QUALIFIED_NAME = KeywordField( "anaplanWorkspaceQualifiedName", "anaplanWorkspaceQualifiedName" diff --git a/pyatlan_v9/model/assets/anaplan_dimension.py b/pyatlan_v9/model/assets/anaplan_dimension.py index 46483ae4d..9a4af60ac 100644 --- a/pyatlan_v9/model/assets/anaplan_dimension.py +++ b/pyatlan_v9/model/assets/anaplan_dimension.py @@ -19,7 +19,22 @@ from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AtlanConnectorType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask +from .anaplan_related import ( + RelatedAnaplanDimension, + RelatedAnaplanLineItem, + RelatedAnaplanModel, + RelatedAnaplanView, +) from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -47,21 +62,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.enums import AtlanConnectorType -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .anaplan_related import ( - RelatedAnaplanDimension, - RelatedAnaplanLineItem, - RelatedAnaplanModel, - RelatedAnaplanView, -) # ============================================================================= # FLAT ASSET CLASS @@ -768,33 +768,36 @@ def _anaplan_dimension_from_nested(nested: AnaplanDimensionNested) -> AnaplanDim _ANAPLAN_DIMENSION_REL_FIELDS, AnaplanDimensionRelationshipAttributes, ) - return AnaplanDimension( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_dimension_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_dimension_attrs(attrs)) + kwargs.update(merged_rels) + return AnaplanDimension(**kwargs) def _anaplan_dimension_to_nested_bytes( @@ -813,10 +816,7 @@ def _anaplan_dimension_from_nested_bytes(data: bytes, serde: Serde) -> AnaplanDi # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AnaplanDimension.ANAPLAN_WORKSPACE_QUALIFIED_NAME = KeywordField( "anaplanWorkspaceQualifiedName", "anaplanWorkspaceQualifiedName" diff --git a/pyatlan_v9/model/assets/anaplan_line_item.py b/pyatlan_v9/model/assets/anaplan_line_item.py index 69a7e7393..cd74c450a 100644 --- a/pyatlan_v9/model/assets/anaplan_line_item.py +++ b/pyatlan_v9/model/assets/anaplan_line_item.py @@ -19,7 +19,22 @@ from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AtlanConnectorType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask +from .anaplan_related import ( + RelatedAnaplanDimension, + RelatedAnaplanLineItem, + RelatedAnaplanList, + RelatedAnaplanModule, +) from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -47,21 +62,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.enums import AtlanConnectorType -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .anaplan_related import ( - RelatedAnaplanDimension, - RelatedAnaplanLineItem, - RelatedAnaplanList, - RelatedAnaplanModule, -) # ============================================================================= # FLAT ASSET CLASS @@ -769,33 +769,36 @@ def _anaplan_line_item_from_nested(nested: AnaplanLineItemNested) -> AnaplanLine _ANAPLAN_LINE_ITEM_REL_FIELDS, AnaplanLineItemRelationshipAttributes, ) - return AnaplanLineItem( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_line_item_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_line_item_attrs(attrs)) + kwargs.update(merged_rels) + return AnaplanLineItem(**kwargs) def _anaplan_line_item_to_nested_bytes( @@ -814,10 +817,7 @@ def _anaplan_line_item_from_nested_bytes(data: bytes, serde: Serde) -> AnaplanLi # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AnaplanLineItem.ANAPLAN_LINE_ITEM_FORMULA = KeywordField( "anaplanLineItemFormula", "anaplanLineItemFormula" diff --git a/pyatlan_v9/model/assets/anaplan_list.py b/pyatlan_v9/model/assets/anaplan_list.py index 919e50129..30fb04abc 100644 --- a/pyatlan_v9/model/assets/anaplan_list.py +++ b/pyatlan_v9/model/assets/anaplan_list.py @@ -19,7 +19,21 @@ from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AtlanConnectorType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask +from .anaplan_related import ( + RelatedAnaplanLineItem, + RelatedAnaplanList, + RelatedAnaplanModel, +) from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -47,20 +61,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.enums import AtlanConnectorType -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .anaplan_related import ( - RelatedAnaplanLineItem, - RelatedAnaplanList, - RelatedAnaplanModel, -) # ============================================================================= # FLAT ASSET CLASS @@ -740,33 +740,36 @@ def _anaplan_list_from_nested(nested: AnaplanListNested) -> AnaplanList: _ANAPLAN_LIST_REL_FIELDS, AnaplanListRelationshipAttributes, ) - return AnaplanList( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_list_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_list_attrs(attrs)) + kwargs.update(merged_rels) + return AnaplanList(**kwargs) def _anaplan_list_to_nested_bytes(anaplan_list: AnaplanList, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/anaplan_model.py b/pyatlan_v9/model/assets/anaplan_model.py index 5dfb6c4b3..22eeb96db 100644 --- a/pyatlan_v9/model/assets/anaplan_model.py +++ b/pyatlan_v9/model/assets/anaplan_model.py @@ -19,7 +19,24 @@ from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AtlanConnectorType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask +from .anaplan_related import ( + RelatedAnaplanDimension, + RelatedAnaplanList, + RelatedAnaplanModel, + RelatedAnaplanModule, + RelatedAnaplanPage, + RelatedAnaplanWorkspace, +) from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -47,23 +64,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.enums import AtlanConnectorType -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .anaplan_related import ( - RelatedAnaplanDimension, - RelatedAnaplanList, - RelatedAnaplanModel, - RelatedAnaplanModule, - RelatedAnaplanPage, - RelatedAnaplanWorkspace, -) # ============================================================================= # FLAT ASSET CLASS @@ -749,33 +749,36 @@ def _anaplan_model_from_nested(nested: AnaplanModelNested) -> AnaplanModel: _ANAPLAN_MODEL_REL_FIELDS, AnaplanModelRelationshipAttributes, ) - return AnaplanModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_model_attrs(attrs)) + kwargs.update(merged_rels) + return AnaplanModel(**kwargs) def _anaplan_model_to_nested_bytes(anaplan_model: AnaplanModel, serde: Serde) -> bytes: @@ -792,10 +795,7 @@ def _anaplan_model_from_nested_bytes(data: bytes, serde: Serde) -> AnaplanModel: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AnaplanModel.ANAPLAN_WORKSPACE_QUALIFIED_NAME = KeywordField( "anaplanWorkspaceQualifiedName", "anaplanWorkspaceQualifiedName" diff --git a/pyatlan_v9/model/assets/anaplan_module.py b/pyatlan_v9/model/assets/anaplan_module.py index d1ce6ef4c..e6b63e0e2 100644 --- a/pyatlan_v9/model/assets/anaplan_module.py +++ b/pyatlan_v9/model/assets/anaplan_module.py @@ -19,7 +19,22 @@ from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AtlanConnectorType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask +from .anaplan_related import ( + RelatedAnaplanLineItem, + RelatedAnaplanModel, + RelatedAnaplanModule, + RelatedAnaplanView, +) from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -47,21 +62,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.enums import AtlanConnectorType -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .anaplan_related import ( - RelatedAnaplanLineItem, - RelatedAnaplanModel, - RelatedAnaplanModule, - RelatedAnaplanView, -) # ============================================================================= # FLAT ASSET CLASS @@ -737,33 +737,36 @@ def _anaplan_module_from_nested(nested: AnaplanModuleNested) -> AnaplanModule: _ANAPLAN_MODULE_REL_FIELDS, AnaplanModuleRelationshipAttributes, ) - return AnaplanModule( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_module_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_module_attrs(attrs)) + kwargs.update(merged_rels) + return AnaplanModule(**kwargs) def _anaplan_module_to_nested_bytes( @@ -782,10 +785,7 @@ def _anaplan_module_from_nested_bytes(data: bytes, serde: Serde) -> AnaplanModul # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AnaplanModule.ANAPLAN_WORKSPACE_QUALIFIED_NAME = KeywordField( "anaplanWorkspaceQualifiedName", "anaplanWorkspaceQualifiedName" diff --git a/pyatlan_v9/model/assets/anaplan_page.py b/pyatlan_v9/model/assets/anaplan_page.py index da85fd2bd..9c9ea68bd 100644 --- a/pyatlan_v9/model/assets/anaplan_page.py +++ b/pyatlan_v9/model/assets/anaplan_page.py @@ -19,7 +19,17 @@ from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AtlanConnectorType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask +from .anaplan_related import RelatedAnaplanApp, RelatedAnaplanModel, RelatedAnaplanPage from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -47,16 +57,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.enums import AtlanConnectorType -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .anaplan_related import RelatedAnaplanApp, RelatedAnaplanModel, RelatedAnaplanPage # ============================================================================= # FLAT ASSET CLASS @@ -737,33 +737,36 @@ def _anaplan_page_from_nested(nested: AnaplanPageNested) -> AnaplanPage: _ANAPLAN_PAGE_REL_FIELDS, AnaplanPageRelationshipAttributes, ) - return AnaplanPage( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_page_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_page_attrs(attrs)) + kwargs.update(merged_rels) + return AnaplanPage(**kwargs) def _anaplan_page_to_nested_bytes(anaplan_page: AnaplanPage, serde: Serde) -> bytes: @@ -780,10 +783,7 @@ def _anaplan_page_from_nested_bytes(data: bytes, serde: Serde) -> AnaplanPage: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AnaplanPage.ANAPLAN_APP_QUALIFIED_NAME = KeywordField( "anaplanAppQualifiedName", "anaplanAppQualifiedName" diff --git a/pyatlan_v9/model/assets/anaplan_system_dimension.py b/pyatlan_v9/model/assets/anaplan_system_dimension.py index 191575863..8179b6f2e 100644 --- a/pyatlan_v9/model/assets/anaplan_system_dimension.py +++ b/pyatlan_v9/model/assets/anaplan_system_dimension.py @@ -18,7 +18,16 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask +from .anaplan_related import RelatedAnaplanSystemDimension from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -46,15 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .anaplan_related import RelatedAnaplanSystemDimension # ============================================================================= # FLAT ASSET CLASS @@ -684,33 +684,36 @@ def _anaplan_system_dimension_from_nested( _ANAPLAN_SYSTEM_DIMENSION_REL_FIELDS, AnaplanSystemDimensionRelationshipAttributes, ) - return AnaplanSystemDimension( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_system_dimension_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_system_dimension_attrs(attrs)) + kwargs.update(merged_rels) + return AnaplanSystemDimension(**kwargs) def _anaplan_system_dimension_to_nested_bytes( @@ -731,10 +734,7 @@ def _anaplan_system_dimension_from_nested_bytes( # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AnaplanSystemDimension.ANAPLAN_WORKSPACE_QUALIFIED_NAME = KeywordField( "anaplanWorkspaceQualifiedName", "anaplanWorkspaceQualifiedName" diff --git a/pyatlan_v9/model/assets/anaplan_view.py b/pyatlan_v9/model/assets/anaplan_view.py index eb95eca23..81007e019 100644 --- a/pyatlan_v9/model/assets/anaplan_view.py +++ b/pyatlan_v9/model/assets/anaplan_view.py @@ -19,7 +19,21 @@ from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AtlanConnectorType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask +from .anaplan_related import ( + RelatedAnaplanDimension, + RelatedAnaplanModule, + RelatedAnaplanView, +) from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -47,20 +61,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.enums import AtlanConnectorType -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .anaplan_related import ( - RelatedAnaplanDimension, - RelatedAnaplanModule, - RelatedAnaplanView, -) # ============================================================================= # FLAT ASSET CLASS @@ -767,33 +767,36 @@ def _anaplan_view_from_nested(nested: AnaplanViewNested) -> AnaplanView: _ANAPLAN_VIEW_REL_FIELDS, AnaplanViewRelationshipAttributes, ) - return AnaplanView( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_view_attrs(attrs)) + kwargs.update(merged_rels) + return AnaplanView(**kwargs) def _anaplan_view_to_nested_bytes(anaplan_view: AnaplanView, serde: Serde) -> bytes: @@ -810,10 +813,7 @@ def _anaplan_view_from_nested_bytes(data: bytes, serde: Serde) -> AnaplanView: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AnaplanView.ANAPLAN_WORKSPACE_QUALIFIED_NAME = KeywordField( "anaplanWorkspaceQualifiedName", "anaplanWorkspaceQualifiedName" diff --git a/pyatlan_v9/model/assets/anaplan_workspace.py b/pyatlan_v9/model/assets/anaplan_workspace.py index 870bbe555..1b1df19bc 100644 --- a/pyatlan_v9/model/assets/anaplan_workspace.py +++ b/pyatlan_v9/model/assets/anaplan_workspace.py @@ -18,7 +18,16 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask +from .anaplan_related import RelatedAnaplanModel, RelatedAnaplanWorkspace from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -46,15 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .anaplan_related import RelatedAnaplanModel, RelatedAnaplanWorkspace # ============================================================================= # FLAT ASSET CLASS @@ -704,33 +704,36 @@ def _anaplan_workspace_from_nested(nested: AnaplanWorkspaceNested) -> AnaplanWor _ANAPLAN_WORKSPACE_REL_FIELDS, AnaplanWorkspaceRelationshipAttributes, ) - return AnaplanWorkspace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anaplan_workspace_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anaplan_workspace_attrs(attrs)) + kwargs.update(merged_rels) + return AnaplanWorkspace(**kwargs) def _anaplan_workspace_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/anomalo.py b/pyatlan_v9/model/assets/anomalo.py index 1b9fc92cc..0df633c69 100644 --- a/pyatlan_v9/model/assets/anomalo.py +++ b/pyatlan_v9/model/assets/anomalo.py @@ -18,7 +18,15 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask +from .anomalo_related import RelatedAnomalo, RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, @@ -45,14 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .anomalo_related import RelatedAnomalo, RelatedAnomaloCheck # ============================================================================= # FLAT ASSET CLASS @@ -578,33 +578,36 @@ def _anomalo_from_nested(nested: AnomaloNested) -> Anomalo: _ANOMALO_REL_FIELDS, AnomaloRelationshipAttributes, ) - return Anomalo( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anomalo_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anomalo_attrs(attrs)) + kwargs.update(merged_rels) + return Anomalo(**kwargs) def _anomalo_to_nested_bytes(anomalo: Anomalo, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/anomalo_check.py b/pyatlan_v9/model/assets/anomalo_check.py index e253ffee7..6b19bca46 100644 --- a/pyatlan_v9/model/assets/anomalo_check.py +++ b/pyatlan_v9/model/assets/anomalo_check.py @@ -18,7 +18,15 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask +from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .anomalo_related import RelatedAnomaloCheck # ============================================================================= # FLAT ASSET CLASS @@ -706,33 +706,36 @@ def _anomalo_check_from_nested(nested: AnomaloCheckNested) -> AnomaloCheck: _ANOMALO_CHECK_REL_FIELDS, AnomaloCheckRelationshipAttributes, ) - return AnomaloCheck( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_anomalo_check_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_anomalo_check_attrs(attrs)) + kwargs.update(merged_rels) + return AnomaloCheck(**kwargs) def _anomalo_check_to_nested_bytes(anomalo_check: AnomaloCheck, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/api.py b/pyatlan_v9/model/assets/api.py index a5a1f8e79..344793f1a 100644 --- a/pyatlan_v9/model/assets/api.py +++ b/pyatlan_v9/model/assets/api.py @@ -18,8 +18,16 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck +from .api_related import RelatedAPI from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .api_related import RelatedAPI # ============================================================================= # FLAT ASSET CLASS @@ -638,33 +638,36 @@ def _api_from_nested(nested: APINested) -> API: _API_REL_FIELDS, APIRelationshipAttributes, ) - return API( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_api_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_api_attrs(attrs)) + kwargs.update(merged_rels) + return API(**kwargs) def _api_to_nested_bytes(api: API, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/api_field.py b/pyatlan_v9/model/assets/api_field.py index c1f59b627..ff61daeeb 100644 --- a/pyatlan_v9/model/assets/api_field.py +++ b/pyatlan_v9/model/assets/api_field.py @@ -19,8 +19,17 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck +from .api_related import RelatedAPIField, RelatedAPIObject, RelatedAPIQuery from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, @@ -47,15 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .api_related import RelatedAPIField, RelatedAPIObject, RelatedAPIQuery # ============================================================================= # FLAT ASSET CLASS @@ -826,33 +826,36 @@ def _api_field_from_nested(nested: APIFieldNested) -> APIField: _API_FIELD_REL_FIELDS, APIFieldRelationshipAttributes, ) - return APIField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_api_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_api_field_attrs(attrs)) + kwargs.update(merged_rels) + return APIField(**kwargs) def _api_field_to_nested_bytes(api_field: APIField, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/api_object.py b/pyatlan_v9/model/assets/api_object.py index 028daeaaa..0d65d8dec 100644 --- a/pyatlan_v9/model/assets/api_object.py +++ b/pyatlan_v9/model/assets/api_object.py @@ -18,8 +18,17 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck +from .api_related import RelatedAPIField, RelatedAPIObject from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, @@ -46,15 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .api_related import RelatedAPIField, RelatedAPIObject # ============================================================================= # FLAT ASSET CLASS @@ -695,33 +695,36 @@ def _api_object_from_nested(nested: APIObjectNested) -> APIObject: _API_OBJECT_REL_FIELDS, APIObjectRelationshipAttributes, ) - return APIObject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_api_object_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_api_object_attrs(attrs)) + kwargs.update(merged_rels) + return APIObject(**kwargs) def _api_object_to_nested_bytes(api_object: APIObject, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/api_path.py b/pyatlan_v9/model/assets/api_path.py index 05ce3ef6a..838b50e61 100644 --- a/pyatlan_v9/model/assets/api_path.py +++ b/pyatlan_v9/model/assets/api_path.py @@ -20,8 +20,17 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck +from .api_related import RelatedAPIPath, RelatedAPISpec from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, @@ -48,15 +57,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .api_related import RelatedAPIPath, RelatedAPISpec # ============================================================================= # FLAT ASSET CLASS @@ -783,33 +783,36 @@ def _api_path_from_nested(nested: APIPathNested) -> APIPath: _API_PATH_REL_FIELDS, APIPathRelationshipAttributes, ) - return APIPath( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_api_path_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_api_path_attrs(attrs)) + kwargs.update(merged_rels) + return APIPath(**kwargs) def _api_path_to_nested_bytes(api_path: APIPath, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/api_query.py b/pyatlan_v9/model/assets/api_query.py index 7bc5785c1..d93001bbc 100644 --- a/pyatlan_v9/model/assets/api_query.py +++ b/pyatlan_v9/model/assets/api_query.py @@ -18,8 +18,17 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck +from .api_related import RelatedAPIField, RelatedAPIQuery from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, @@ -46,15 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .api_related import RelatedAPIField, RelatedAPIQuery # ============================================================================= # FLAT ASSET CLASS @@ -740,33 +740,36 @@ def _api_query_from_nested(nested: APIQueryNested) -> APIQuery: _API_QUERY_REL_FIELDS, APIQueryRelationshipAttributes, ) - return APIQuery( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_api_query_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_api_query_attrs(attrs)) + kwargs.update(merged_rels) + return APIQuery(**kwargs) def _api_query_to_nested_bytes(api_query: APIQuery, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/api_spec.py b/pyatlan_v9/model/assets/api_spec.py index ede18bec3..d248c5fa2 100644 --- a/pyatlan_v9/model/assets/api_spec.py +++ b/pyatlan_v9/model/assets/api_spec.py @@ -19,8 +19,17 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck +from .api_related import RelatedAPIPath, RelatedAPISpec from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, @@ -47,15 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .api_related import RelatedAPIPath, RelatedAPISpec # ============================================================================= # FLAT ASSET CLASS @@ -762,33 +762,36 @@ def _api_spec_from_nested(nested: APISpecNested) -> APISpec: _API_SPEC_REL_FIELDS, APISpecRelationshipAttributes, ) - return APISpec( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_api_spec_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_api_spec_attrs(attrs)) + kwargs.update(merged_rels) + return APISpec(**kwargs) def _api_spec_to_nested_bytes(api_spec: APISpec, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/app.py b/pyatlan_v9/model/assets/app.py index 76652e95b..fa4cce614 100644 --- a/pyatlan_v9/model/assets/app.py +++ b/pyatlan_v9/model/assets/app.py @@ -18,8 +18,16 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck +from .app_related import RelatedApp, RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, Asset, @@ -45,14 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .app_related import RelatedApp, RelatedApplication, RelatedApplicationField # ============================================================================= # FLAT ASSET CLASS @@ -574,33 +574,36 @@ def _app_from_nested(nested: AppNested) -> App: _APP_REL_FIELDS, AppRelationshipAttributes, ) - return App( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_app_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_app_attrs(attrs)) + kwargs.update(merged_rels) + return App(**kwargs) def _app_to_nested_bytes(app: App, serde: Serde) -> bytes: @@ -617,10 +620,7 @@ def _app_from_nested_bytes(data: bytes, serde: Serde) -> App: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 App.APP_ID = KeywordField("appId", "appId") App.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") diff --git a/pyatlan_v9/model/assets/app_workflow_run.py b/pyatlan_v9/model/assets/app_workflow_run.py index 4a744a831..1f10c7dd5 100644 --- a/pyatlan_v9/model/assets/app_workflow_run.py +++ b/pyatlan_v9/model/assets/app_workflow_run.py @@ -18,9 +18,17 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField +from .app_workflow_run_related import RelatedAppWorkflowRun from .asset import ( _ASSET_REL_FIELDS, Asset, @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .app_workflow_run_related import RelatedAppWorkflowRun # ============================================================================= # FLAT ASSET CLASS @@ -796,33 +796,36 @@ def _app_workflow_run_from_nested(nested: AppWorkflowRunNested) -> AppWorkflowRu _APP_WORKFLOW_RUN_REL_FIELDS, AppWorkflowRunRelationshipAttributes, ) - return AppWorkflowRun( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_app_workflow_run_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_app_workflow_run_attrs(attrs)) + kwargs.update(merged_rels) + return AppWorkflowRun(**kwargs) def _app_workflow_run_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/application.py b/pyatlan_v9/model/assets/application.py index 0f38a349f..8e06267f0 100644 --- a/pyatlan_v9/model/assets/application.py +++ b/pyatlan_v9/model/assets/application.py @@ -18,8 +18,17 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck +from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, Asset, @@ -46,15 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .app_related import RelatedApplication, RelatedApplicationField # ============================================================================= # FLAT ASSET CLASS @@ -636,33 +636,36 @@ def _application_from_nested(nested: ApplicationNested) -> Application: _APPLICATION_REL_FIELDS, ApplicationRelationshipAttributes, ) - return Application( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_application_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_application_attrs(attrs)) + kwargs.update(merged_rels) + return Application(**kwargs) def _application_to_nested_bytes(application: Application, serde: Serde) -> bytes: @@ -679,10 +682,7 @@ def _application_from_nested_bytes(data: bytes, serde: Serde) -> Application: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Application.APP_ID = KeywordField("appId", "appId") Application.CATALOG_DATASET_GUID = KeywordField( diff --git a/pyatlan_v9/model/assets/application_field.py b/pyatlan_v9/model/assets/application_field.py index afc943f1f..598a5e571 100644 --- a/pyatlan_v9/model/assets/application_field.py +++ b/pyatlan_v9/model/assets/application_field.py @@ -19,8 +19,17 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck +from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( _ASSET_REL_FIELDS, Asset, @@ -47,15 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .app_related import RelatedApplication, RelatedApplicationField # ============================================================================= # FLAT ASSET CLASS @@ -683,33 +683,36 @@ def _application_field_from_nested(nested: ApplicationFieldNested) -> Applicatio _APPLICATION_FIELD_REL_FIELDS, ApplicationFieldRelationshipAttributes, ) - return ApplicationField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_application_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_application_field_attrs(attrs)) + kwargs.update(merged_rels) + return ApplicationField(**kwargs) def _application_field_to_nested_bytes( @@ -728,10 +731,7 @@ def _application_field_from_nested_bytes(data: bytes, serde: Serde) -> Applicati # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 ApplicationField.APPLICATION_PARENT_QUALIFIED_NAME = KeywordField( "applicationParentQualifiedName", "applicationParentQualifiedName" diff --git a/pyatlan_v9/model/assets/artifact.py b/pyatlan_v9/model/assets/artifact.py index c33b0e5c8..fd399cea5 100644 --- a/pyatlan_v9/model/assets/artifact.py +++ b/pyatlan_v9/model/assets/artifact.py @@ -18,9 +18,17 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField +from .artifact_related import RelatedArtifact from .asset import ( _ASSET_REL_FIELDS, Asset, @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .artifact_related import RelatedArtifact # ============================================================================= # FLAT ASSET CLASS @@ -665,33 +665,36 @@ def _artifact_from_nested(nested: ArtifactNested) -> Artifact: _ARTIFACT_REL_FIELDS, ArtifactRelationshipAttributes, ) - return Artifact( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_artifact_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_artifact_attrs(attrs)) + kwargs.update(merged_rels) + return Artifact(**kwargs) def _artifact_to_nested_bytes(artifact: Artifact, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/asset.py b/pyatlan_v9/model/assets/asset.py index fa052533d..1d57db8c7 100644 --- a/pyatlan_v9/model/assets/asset.py +++ b/pyatlan_v9/model/assets/asset.py @@ -19,8 +19,18 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.assets.related_entity import SaveSemantic +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.core import Announcement +from pyatlan_v9.model.enums import AnnouncementType +from pyatlan_v9.model.serde import Serde, get_serde + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField +from .asset_related import RelatedAsset from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -42,16 +52,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.assets.related_entity import SaveSemantic -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.core import Announcement -from pyatlan_v9.model.enums import AnnouncementType -from pyatlan_v9.model.serde import Serde, get_serde - -from .asset_related import RelatedAsset # ============================================================================= # FLAT ASSET CLASS @@ -2892,33 +2892,36 @@ def _asset_from_nested(nested: AssetNested) -> Asset: _ASSET_REL_FIELDS, AssetRelationshipAttributes, ) - return Asset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_asset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_asset_attrs(attrs)) + kwargs.update(merged_rels) + return Asset(**kwargs) def _asset_to_nested_bytes(asset: Asset, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/asset_grouping.py b/pyatlan_v9/model/assets/asset_grouping.py index be1b96c89..861d88f7a 100644 --- a/pyatlan_v9/model/assets/asset_grouping.py +++ b/pyatlan_v9/model/assets/asset_grouping.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .asset_grouping_related import RelatedAssetGrouping from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .asset_grouping_related import RelatedAssetGrouping # ============================================================================= # FLAT ASSET CLASS @@ -578,33 +578,36 @@ def _asset_grouping_from_nested(nested: AssetGroupingNested) -> AssetGrouping: _ASSET_GROUPING_REL_FIELDS, AssetGroupingRelationshipAttributes, ) - return AssetGrouping( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_asset_grouping_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_asset_grouping_attrs(attrs)) + kwargs.update(merged_rels) + return AssetGrouping(**kwargs) def _asset_grouping_to_nested_bytes( @@ -623,10 +626,7 @@ def _asset_grouping_from_nested_bytes(data: bytes, serde: Serde) -> AssetGroupin # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AssetGrouping.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/asset_grouping_collection.py b/pyatlan_v9/model/assets/asset_grouping_collection.py index 0b7ec0c0e..97766d607 100644 --- a/pyatlan_v9/model/assets/asset_grouping_collection.py +++ b/pyatlan_v9/model/assets/asset_grouping_collection.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,10 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .asset_grouping_related import ( + RelatedAssetGroupingCollection, + RelatedAssetGroupingStrategy, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,17 +58,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .asset_grouping_related import ( - RelatedAssetGroupingCollection, - RelatedAssetGroupingStrategy, -) # ============================================================================= # FLAT ASSET CLASS @@ -618,33 +618,36 @@ def _asset_grouping_collection_from_nested( _ASSET_GROUPING_COLLECTION_REL_FIELDS, AssetGroupingCollectionRelationshipAttributes, ) - return AssetGroupingCollection( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_asset_grouping_collection_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_asset_grouping_collection_attrs(attrs)) + kwargs.update(merged_rels) + return AssetGroupingCollection(**kwargs) def _asset_grouping_collection_to_nested_bytes( @@ -665,10 +668,7 @@ def _asset_grouping_collection_from_nested_bytes( # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AssetGroupingCollection.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/asset_grouping_related.py b/pyatlan_v9/model/assets/asset_grouping_related.py index 1908c81f2..8b94fbe11 100644 --- a/pyatlan_v9/model/assets/asset_grouping_related.py +++ b/pyatlan_v9/model/assets/asset_grouping_related.py @@ -11,7 +11,6 @@ from __future__ import annotations - from msgspec import UNSET from .catalog_related import RelatedCatalog diff --git a/pyatlan_v9/model/assets/asset_grouping_strategy.py b/pyatlan_v9/model/assets/asset_grouping_strategy.py index 137c2d6d6..5676c1157 100644 --- a/pyatlan_v9/model/assets/asset_grouping_strategy.py +++ b/pyatlan_v9/model/assets/asset_grouping_strategy.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,10 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .asset_grouping_related import ( + RelatedAssetGroupingCollection, + RelatedAssetGroupingStrategy, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,17 +57,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .asset_grouping_related import ( - RelatedAssetGroupingCollection, - RelatedAssetGroupingStrategy, -) # ============================================================================= # FLAT ASSET CLASS @@ -603,33 +603,36 @@ def _asset_grouping_strategy_from_nested( _ASSET_GROUPING_STRATEGY_REL_FIELDS, AssetGroupingStrategyRelationshipAttributes, ) - return AssetGroupingStrategy( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_asset_grouping_strategy_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_asset_grouping_strategy_attrs(attrs)) + kwargs.update(merged_rels) + return AssetGroupingStrategy(**kwargs) def _asset_grouping_strategy_to_nested_bytes( @@ -650,10 +653,7 @@ def _asset_grouping_strategy_from_nested_bytes( # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AssetGroupingStrategy.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/atlan_app.py b/pyatlan_v9/model/assets/atlan_app.py index 302394b38..b980541d2 100644 --- a/pyatlan_v9/model/assets/atlan_app.py +++ b/pyatlan_v9/model/assets/atlan_app.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .atlan_app_related import ( + RelatedAtlanApp, + RelatedAtlanAppTool, + RelatedAtlanAppWorkflow, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,18 +58,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .atlan_app_related import ( - RelatedAtlanApp, - RelatedAtlanAppTool, - RelatedAtlanAppWorkflow, -) # ============================================================================= # FLAT ASSET CLASS @@ -628,33 +628,36 @@ def _atlan_app_from_nested(nested: AtlanAppNested) -> AtlanApp: _ATLAN_APP_REL_FIELDS, AtlanAppRelationshipAttributes, ) - return AtlanApp( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_atlan_app_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_atlan_app_attrs(attrs)) + kwargs.update(merged_rels) + return AtlanApp(**kwargs) def _atlan_app_to_nested_bytes(atlan_app: AtlanApp, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/atlan_app_deployment.py b/pyatlan_v9/model/assets/atlan_app_deployment.py index c0c32c9af..4b38e747d 100644 --- a/pyatlan_v9/model/assets/atlan_app_deployment.py +++ b/pyatlan_v9/model/assets/atlan_app_deployment.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .atlan_app_related import ( + RelatedAtlanAppDeployment, + RelatedAtlanAppTool, + RelatedAtlanAppWorkflow, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .atlan_app_related import ( - RelatedAtlanAppDeployment, - RelatedAtlanAppTool, - RelatedAtlanAppWorkflow, -) # ============================================================================= # FLAT ASSET CLASS @@ -701,33 +701,36 @@ def _atlan_app_deployment_from_nested( _ATLAN_APP_DEPLOYMENT_REL_FIELDS, AtlanAppDeploymentRelationshipAttributes, ) - return AtlanAppDeployment( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_atlan_app_deployment_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_atlan_app_deployment_attrs(attrs)) + kwargs.update(merged_rels) + return AtlanAppDeployment(**kwargs) def _atlan_app_deployment_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/atlan_app_installed.py b/pyatlan_v9/model/assets/atlan_app_installed.py index 6fe17817a..77190e6f9 100644 --- a/pyatlan_v9/model/assets/atlan_app_installed.py +++ b/pyatlan_v9/model/assets/atlan_app_installed.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .atlan_app_related import ( + RelatedAtlanAppInstalled, + RelatedAtlanAppTool, + RelatedAtlanAppWorkflow, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .atlan_app_related import ( - RelatedAtlanAppInstalled, - RelatedAtlanAppTool, - RelatedAtlanAppWorkflow, -) # ============================================================================= # FLAT ASSET CLASS @@ -683,33 +683,36 @@ def _atlan_app_installed_from_nested( _ATLAN_APP_INSTALLED_REL_FIELDS, AtlanAppInstalledRelationshipAttributes, ) - return AtlanAppInstalled( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_atlan_app_installed_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_atlan_app_installed_attrs(attrs)) + kwargs.update(merged_rels) + return AtlanAppInstalled(**kwargs) def _atlan_app_installed_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/atlan_app_tool.py b/pyatlan_v9/model/assets/atlan_app_tool.py index 6a97ae401..c42d20670 100644 --- a/pyatlan_v9/model/assets/atlan_app_tool.py +++ b/pyatlan_v9/model/assets/atlan_app_tool.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .atlan_app_related import ( + RelatedAtlanApp, + RelatedAtlanAppTool, + RelatedAtlanAppWorkflow, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .atlan_app_related import ( - RelatedAtlanApp, - RelatedAtlanAppTool, - RelatedAtlanAppWorkflow, -) # ============================================================================= # FLAT ASSET CLASS @@ -693,33 +693,36 @@ def _atlan_app_tool_from_nested(nested: AtlanAppToolNested) -> AtlanAppTool: _ATLAN_APP_TOOL_REL_FIELDS, AtlanAppToolRelationshipAttributes, ) - return AtlanAppTool( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_atlan_app_tool_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_atlan_app_tool_attrs(attrs)) + kwargs.update(merged_rels) + return AtlanAppTool(**kwargs) def _atlan_app_tool_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/atlan_app_workflow.py b/pyatlan_v9/model/assets/atlan_app_workflow.py index b010469fe..ca851f69c 100644 --- a/pyatlan_v9/model/assets/atlan_app_workflow.py +++ b/pyatlan_v9/model/assets/atlan_app_workflow.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .atlan_app_related import ( + RelatedAtlanApp, + RelatedAtlanAppTool, + RelatedAtlanAppWorkflow, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -48,18 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .atlan_app_related import ( - RelatedAtlanApp, - RelatedAtlanAppTool, - RelatedAtlanAppWorkflow, -) # ============================================================================= # FLAT ASSET CLASS @@ -775,33 +775,36 @@ def _atlan_app_workflow_from_nested(nested: AtlanAppWorkflowNested) -> AtlanAppW _ATLAN_APP_WORKFLOW_REL_FIELDS, AtlanAppWorkflowRelationshipAttributes, ) - return AtlanAppWorkflow( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_atlan_app_workflow_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_atlan_app_workflow_attrs(attrs)) + kwargs.update(merged_rels) + return AtlanAppWorkflow(**kwargs) def _atlan_app_workflow_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/atlas_glossary.py b/pyatlan_v9/model/assets/atlas_glossary.py index 2cad86626..138b64a70 100644 --- a/pyatlan_v9/model/assets/atlas_glossary.py +++ b/pyatlan_v9/model/assets/atlas_glossary.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -35,25 +43,17 @@ from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType +from .gtc_related import ( + RelatedAtlasGlossary, + RelatedAtlasGlossaryCategory, + RelatedAtlasGlossaryTerm, +) from .knowledge_related import RelatedKnowledgeFile from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid - -from .gtc_related import ( - RelatedAtlasGlossary, - RelatedAtlasGlossaryCategory, - RelatedAtlasGlossaryTerm, -) # ============================================================================= # FLAT ASSET CLASS @@ -644,10 +644,7 @@ def _atlas_glossary_from_nested_bytes(data: bytes, serde: Serde) -> AtlasGlossar # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 AtlasGlossary.SHORT_DESCRIPTION = KeywordField("shortDescription", "shortDescription") AtlasGlossary.LONG_DESCRIPTION = KeywordField("longDescription", "longDescription") diff --git a/pyatlan_v9/model/assets/atlas_glossary_category.py b/pyatlan_v9/model/assets/atlas_glossary_category.py index 3956c58af..64432c724 100644 --- a/pyatlan_v9/model/assets/atlas_glossary_category.py +++ b/pyatlan_v9/model/assets/atlas_glossary_category.py @@ -48,6 +48,7 @@ RelatedAtlasGlossaryCategory, RelatedAtlasGlossaryTerm, ) +from .knowledge_related import RelatedKnowledgeFile from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme @@ -69,7 +70,6 @@ class AtlasGlossaryCategory(Asset): LONG_DESCRIPTION: ClassVar[Any] = None ADDITIONAL_ATTRIBUTES: ClassVar[Any] = None CATEGORY_TYPE: ClassVar[Any] = None - ANCHOR: ClassVar[Any] = None ANOMALO_CHECKS: ClassVar[Any] = None APPLICATION: ClassVar[Any] = None APPLICATION_FIELD: ClassVar[Any] = None @@ -84,8 +84,10 @@ class AtlasGlossaryCategory(Asset): GCP_DATAPLEX_ASPECT_TYPE_METADATA_ENTITIES: ClassVar[Any] = None MEANINGS: ClassVar[Any] = None TERMS: ClassVar[Any] = None + ANCHOR: ClassVar[Any] = None CHILDREN_CATEGORIES: ClassVar[Any] = None PARENT_CATEGORY: ClassVar[Any] = None + KNOWLEDGE_LINKED_FILES: ClassVar[Any] = None MC_MONITORS: ClassVar[Any] = None MC_INCIDENTS: ClassVar[Any] = None USER_DEF_RELATIONSHIP_TO: ClassVar[Any] = None @@ -108,9 +110,6 @@ class AtlasGlossaryCategory(Asset): category_type: Union[str, None, UnsetType] = UNSET """""" - anchor: Union[RelatedAtlasGlossary, None, UnsetType] = UNSET - """Glossary in which this category is contained.""" - anomalo_checks: Union[List[RelatedAnomaloCheck], None, UnsetType] = UNSET """Checks that run on this asset.""" @@ -157,6 +156,9 @@ class AtlasGlossaryCategory(Asset): terms: Union[List[RelatedAtlasGlossaryTerm], None, UnsetType] = UNSET """Terms organized within this category.""" + anchor: Union[RelatedAtlasGlossary, None, UnsetType] = UNSET + """Glossary in which this category is contained.""" + children_categories: Union[List[RelatedAtlasGlossaryCategory], None, UnsetType] = ( UNSET ) @@ -165,6 +167,9 @@ class AtlasGlossaryCategory(Asset): parent_category: Union[RelatedAtlasGlossaryCategory, None, UnsetType] = UNSET """Parent category in which this category is located (or empty if this is a root-level category).""" + knowledge_linked_files: Union[List[RelatedKnowledgeFile], None, UnsetType] = UNSET + """Knowledge files linked to this asset.""" + mc_monitors: Union[List[RelatedMCMonitor], None, UnsetType] = UNSET """Monitors that observe this asset.""" @@ -499,9 +504,6 @@ class AtlasGlossaryCategoryAttributes(AssetAttributes): category_type: Union[str, None, UnsetType] = UNSET """""" - anchor: Union[RelatedAtlasGlossary, None, UnsetType] = UNSET - """Glossary in which this category is contained.""" - class AtlasGlossaryCategoryRelationshipAttributes(AssetRelationshipAttributes): """AtlasGlossaryCategory-specific relationship attributes for nested API format.""" @@ -552,6 +554,9 @@ class AtlasGlossaryCategoryRelationshipAttributes(AssetRelationshipAttributes): terms: Union[List[RelatedAtlasGlossaryTerm], None, UnsetType] = UNSET """Terms organized within this category.""" + anchor: Union[RelatedAtlasGlossary, None, UnsetType] = UNSET + """Glossary in which this category is contained.""" + children_categories: Union[List[RelatedAtlasGlossaryCategory], None, UnsetType] = ( UNSET ) @@ -560,6 +565,9 @@ class AtlasGlossaryCategoryRelationshipAttributes(AssetRelationshipAttributes): parent_category: Union[RelatedAtlasGlossaryCategory, None, UnsetType] = UNSET """Parent category in which this category is located (or empty if this is a root-level category).""" + knowledge_linked_files: Union[List[RelatedKnowledgeFile], None, UnsetType] = UNSET + """Knowledge files linked to this asset.""" + mc_monitors: Union[List[RelatedMCMonitor], None, UnsetType] = UNSET """Monitors that observe this asset.""" @@ -627,8 +635,10 @@ class AtlasGlossaryCategoryNested(AssetNested): "gcp_dataplex_aspect_type_metadata_entities", "meanings", "terms", + "anchor", "children_categories", "parent_category", + "knowledge_linked_files", "mc_monitors", "mc_incidents", "user_def_relationship_to", @@ -650,7 +660,6 @@ def _populate_atlas_glossary_category_attrs( attrs.long_description = obj.long_description attrs.additional_attributes = obj.additional_attributes attrs.category_type = obj.category_type - attrs.anchor = obj.anchor def _extract_atlas_glossary_category_attrs( @@ -662,7 +671,6 @@ def _extract_atlas_glossary_category_attrs( result["long_description"] = attrs.long_description result["additional_attributes"] = attrs.additional_attributes result["category_type"] = attrs.category_type - result["anchor"] = attrs.anchor return result @@ -730,32 +738,36 @@ def _atlas_glossary_category_from_nested( _ATLAS_GLOSSARY_CATEGORY_REL_FIELDS, AtlasGlossaryCategoryRelationshipAttributes, ) - return AtlasGlossaryCategory( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_atlas_glossary_category_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_atlas_glossary_category_attrs(attrs)) + kwargs.update(merged_rels) + return AtlasGlossaryCategory(**kwargs) def _atlas_glossary_category_to_nested_bytes( @@ -788,7 +800,6 @@ def _atlas_glossary_category_from_nested_bytes( "additionalAttributes", "additionalAttributes" ) AtlasGlossaryCategory.CATEGORY_TYPE = KeywordField("categoryType", "categoryType") -AtlasGlossaryCategory.ANCHOR = KeywordField("anchor", "anchor") AtlasGlossaryCategory.ANOMALO_CHECKS = RelationField("anomaloChecks") AtlasGlossaryCategory.APPLICATION = RelationField("application") AtlasGlossaryCategory.APPLICATION_FIELD = RelationField("applicationField") @@ -811,8 +822,10 @@ def _atlas_glossary_category_from_nested_bytes( ) AtlasGlossaryCategory.MEANINGS = RelationField("meanings") AtlasGlossaryCategory.TERMS = RelationField("terms") +AtlasGlossaryCategory.ANCHOR = RelationField("anchor") AtlasGlossaryCategory.CHILDREN_CATEGORIES = RelationField("childrenCategories") AtlasGlossaryCategory.PARENT_CATEGORY = RelationField("parentCategory") +AtlasGlossaryCategory.KNOWLEDGE_LINKED_FILES = RelationField("knowledgeLinkedFiles") AtlasGlossaryCategory.MC_MONITORS = RelationField("mcMonitors") AtlasGlossaryCategory.MC_INCIDENTS = RelationField("mcIncidents") AtlasGlossaryCategory.USER_DEF_RELATIONSHIP_TO = RelationField("userDefRelationshipTo") diff --git a/pyatlan_v9/model/assets/atlas_glossary_term.py b/pyatlan_v9/model/assets/atlas_glossary_term.py index b5813f122..0a45bfb32 100644 --- a/pyatlan_v9/model/assets/atlas_glossary_term.py +++ b/pyatlan_v9/model/assets/atlas_glossary_term.py @@ -48,6 +48,7 @@ RelatedAtlasGlossaryCategory, RelatedAtlasGlossaryTerm, ) +from .knowledge_related import RelatedKnowledgeFile from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme @@ -72,7 +73,6 @@ class AtlasGlossaryTerm(Asset): USAGE: ClassVar[Any] = None ADDITIONAL_ATTRIBUTES: ClassVar[Any] = None TERM_TYPE: ClassVar[Any] = None - ANCHOR: ClassVar[Any] = None ANOMALO_CHECKS: ClassVar[Any] = None APPLICATION: ClassVar[Any] = None APPLICATION_FIELD: ClassVar[Any] = None @@ -87,6 +87,7 @@ class AtlasGlossaryTerm(Asset): GCP_DATAPLEX_ASPECT_TYPE_METADATA_ENTITIES: ClassVar[Any] = None ASSIGNED_ENTITIES: ClassVar[Any] = None MEANINGS: ClassVar[Any] = None + ANCHOR: ClassVar[Any] = None CATEGORIES: ClassVar[Any] = None SEE_ALSO: ClassVar[Any] = None SYNONYMS: ClassVar[Any] = None @@ -101,6 +102,7 @@ class AtlasGlossaryTerm(Asset): IS_A: ClassVar[Any] = None VALID_VALUES_FOR: ClassVar[Any] = None VALID_VALUES: ClassVar[Any] = None + KNOWLEDGE_LINKED_FILES: ClassVar[Any] = None MC_MONITORS: ClassVar[Any] = None MC_INCIDENTS: ClassVar[Any] = None USER_DEF_RELATIONSHIP_TO: ClassVar[Any] = None @@ -132,9 +134,6 @@ class AtlasGlossaryTerm(Asset): term_type: Union[str, None, UnsetType] = UNSET """""" - anchor: Union[RelatedAtlasGlossary, None, UnsetType] = UNSET - """Glossary in which this term is contained.""" - anomalo_checks: Union[List[RelatedAnomaloCheck], None, UnsetType] = UNSET """Checks that run on this asset.""" @@ -181,6 +180,9 @@ class AtlasGlossaryTerm(Asset): meanings: Union[List[RelatedAtlasGlossaryTerm], None, UnsetType] = UNSET """Glossary terms that are linked to this asset.""" + anchor: Union[RelatedAtlasGlossary, None, UnsetType] = UNSET + """Glossary in which this term is contained.""" + categories: Union[List[RelatedAtlasGlossaryCategory], None, UnsetType] = UNSET """Categories within which this term is organized.""" @@ -223,6 +225,9 @@ class AtlasGlossaryTerm(Asset): valid_values: Union[List[RelatedAtlasGlossaryTerm], None, UnsetType] = UNSET """Valid values for this term.""" + knowledge_linked_files: Union[List[RelatedKnowledgeFile], None, UnsetType] = UNSET + """Knowledge files linked to this asset.""" + mc_monitors: Union[List[RelatedMCMonitor], None, UnsetType] = UNSET """Monitors that observe this asset.""" @@ -548,9 +553,6 @@ class AtlasGlossaryTermAttributes(AssetAttributes): term_type: Union[str, None, UnsetType] = UNSET """""" - anchor: Union[RelatedAtlasGlossary, None, UnsetType] = UNSET - """Glossary in which this term is contained.""" - class AtlasGlossaryTermRelationshipAttributes(AssetRelationshipAttributes): """AtlasGlossaryTerm-specific relationship attributes for nested API format.""" @@ -601,6 +603,9 @@ class AtlasGlossaryTermRelationshipAttributes(AssetRelationshipAttributes): meanings: Union[List[RelatedAtlasGlossaryTerm], None, UnsetType] = UNSET """Glossary terms that are linked to this asset.""" + anchor: Union[RelatedAtlasGlossary, None, UnsetType] = UNSET + """Glossary in which this term is contained.""" + categories: Union[List[RelatedAtlasGlossaryCategory], None, UnsetType] = UNSET """Categories within which this term is organized.""" @@ -643,6 +648,9 @@ class AtlasGlossaryTermRelationshipAttributes(AssetRelationshipAttributes): valid_values: Union[List[RelatedAtlasGlossaryTerm], None, UnsetType] = UNSET """Valid values for this term.""" + knowledge_linked_files: Union[List[RelatedKnowledgeFile], None, UnsetType] = UNSET + """Knowledge files linked to this asset.""" + mc_monitors: Union[List[RelatedMCMonitor], None, UnsetType] = UNSET """Monitors that observe this asset.""" @@ -710,6 +718,7 @@ class AtlasGlossaryTermNested(AssetNested): "gcp_dataplex_aspect_type_metadata_entities", "assigned_entities", "meanings", + "anchor", "categories", "see_also", "synonyms", @@ -724,6 +733,7 @@ class AtlasGlossaryTermNested(AssetNested): "is_a", "valid_values_for", "valid_values", + "knowledge_linked_files", "mc_monitors", "mc_incidents", "user_def_relationship_to", @@ -748,7 +758,6 @@ def _populate_atlas_glossary_term_attrs( attrs.usage = obj.usage attrs.additional_attributes = obj.additional_attributes attrs.term_type = obj.term_type - attrs.anchor = obj.anchor def _extract_atlas_glossary_term_attrs(attrs: AtlasGlossaryTermAttributes) -> dict: @@ -761,7 +770,6 @@ def _extract_atlas_glossary_term_attrs(attrs: AtlasGlossaryTermAttributes) -> di result["usage"] = attrs.usage result["additional_attributes"] = attrs.additional_attributes result["term_type"] = attrs.term_type - result["anchor"] = attrs.anchor return result @@ -829,32 +837,36 @@ def _atlas_glossary_term_from_nested( _ATLAS_GLOSSARY_TERM_REL_FIELDS, AtlasGlossaryTermRelationshipAttributes, ) - return AtlasGlossaryTerm( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_atlas_glossary_term_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_atlas_glossary_term_attrs(attrs)) + kwargs.update(merged_rels) + return AtlasGlossaryTerm(**kwargs) def _atlas_glossary_term_to_nested_bytes( @@ -888,7 +900,6 @@ def _atlas_glossary_term_from_nested_bytes( "additionalAttributes", "additionalAttributes" ) AtlasGlossaryTerm.TERM_TYPE = KeywordField("termType", "termType") -AtlasGlossaryTerm.ANCHOR = KeywordField("anchor", "anchor") AtlasGlossaryTerm.ANOMALO_CHECKS = RelationField("anomaloChecks") AtlasGlossaryTerm.APPLICATION = RelationField("application") AtlasGlossaryTerm.APPLICATION_FIELD = RelationField("applicationField") @@ -907,6 +918,7 @@ def _atlas_glossary_term_from_nested_bytes( ) AtlasGlossaryTerm.ASSIGNED_ENTITIES = RelationField("assignedEntities") AtlasGlossaryTerm.MEANINGS = RelationField("meanings") +AtlasGlossaryTerm.ANCHOR = RelationField("anchor") AtlasGlossaryTerm.CATEGORIES = RelationField("categories") AtlasGlossaryTerm.SEE_ALSO = RelationField("seeAlso") AtlasGlossaryTerm.SYNONYMS = RelationField("synonyms") @@ -921,6 +933,7 @@ def _atlas_glossary_term_from_nested_bytes( AtlasGlossaryTerm.IS_A = RelationField("isA") AtlasGlossaryTerm.VALID_VALUES_FOR = RelationField("validValuesFor") AtlasGlossaryTerm.VALID_VALUES = RelationField("validValues") +AtlasGlossaryTerm.KNOWLEDGE_LINKED_FILES = RelationField("knowledgeLinkedFiles") AtlasGlossaryTerm.MC_MONITORS = RelationField("mcMonitors") AtlasGlossaryTerm.MC_INCIDENTS = RelationField("mcIncidents") AtlasGlossaryTerm.USER_DEF_RELATIONSHIP_TO = RelationField("userDefRelationshipTo") diff --git a/pyatlan_v9/model/assets/auth_policy.py b/pyatlan_v9/model/assets/auth_policy.py index f40f8d3bb..59e09a35f 100644 --- a/pyatlan_v9/model/assets/auth_policy.py +++ b/pyatlan_v9/model/assets/auth_policy.py @@ -19,6 +19,15 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + +from .access_control_related import RelatedAccessControl, RelatedAuthPolicy from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -42,15 +51,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .access_control_related import RelatedAccessControl, RelatedAuthPolicy # ============================================================================= # FLAT ASSET CLASS @@ -672,33 +672,36 @@ def _auth_policy_from_nested(nested: AuthPolicyNested) -> AuthPolicy: _AUTH_POLICY_REL_FIELDS, AuthPolicyRelationshipAttributes, ) - return AuthPolicy( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_auth_policy_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_auth_policy_attrs(attrs)) + kwargs.update(merged_rels) + return AuthPolicy(**kwargs) def _auth_policy_to_nested_bytes(auth_policy: AuthPolicy, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/auth_service.py b/pyatlan_v9/model/assets/auth_service.py index a809499bf..9bc7031b9 100644 --- a/pyatlan_v9/model/assets/auth_service.py +++ b/pyatlan_v9/model/assets/auth_service.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + +from .access_control_related import RelatedAuthPolicy, RelatedAuthService from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -41,14 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .access_control_related import RelatedAuthPolicy, RelatedAuthService # ============================================================================= # FLAT ASSET CLASS @@ -538,33 +538,36 @@ def _auth_service_from_nested(nested: AuthServiceNested) -> AuthService: _AUTH_SERVICE_REL_FIELDS, AuthServiceRelationshipAttributes, ) - return AuthService( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_auth_service_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_auth_service_attrs(attrs)) + kwargs.update(merged_rels) + return AuthService(**kwargs) def _auth_service_to_nested_bytes(auth_service: AuthService, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/aws.py b/pyatlan_v9/model/assets/aws.py index 39745680e..e1f65ab35 100644 --- a/pyatlan_v9/model/assets/aws.py +++ b/pyatlan_v9/model/assets/aws.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -29,6 +36,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cloud_related import RelatedAWS from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -41,14 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cloud_related import RelatedAWS # ============================================================================= # FLAT ASSET CLASS @@ -558,33 +558,36 @@ def _aws_from_nested(nested: AWSNested) -> AWS: _AWS_REL_FIELDS, AWSRelationshipAttributes, ) - return AWS( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_aws_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_aws_attrs(attrs)) + kwargs.update(merged_rels) + return AWS(**kwargs) def _aws_to_nested_bytes(aws: AWS, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/azure.py b/pyatlan_v9/model/assets/azure.py index f5beeb674..ee34e446a 100644 --- a/pyatlan_v9/model/assets/azure.py +++ b/pyatlan_v9/model/assets/azure.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -29,6 +36,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cloud_related import RelatedAzure from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -41,14 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cloud_related import RelatedAzure # ============================================================================= # FLAT ASSET CLASS @@ -517,33 +517,36 @@ def _azure_from_nested(nested: AzureNested) -> Azure: _AZURE_REL_FIELDS, AzureRelationshipAttributes, ) - return Azure( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_azure_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_azure_attrs(attrs)) + kwargs.update(merged_rels) + return Azure(**kwargs) def _azure_to_nested_bytes(azure: Azure, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/azure_service_bus.py b/pyatlan_v9/model/assets/azure_service_bus.py index 4acc6022b..8acc0e35d 100644 --- a/pyatlan_v9/model/assets/azure_service_bus.py +++ b/pyatlan_v9/model/assets/azure_service_bus.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .azure_service_bus_related import RelatedAzureServiceBus from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .azure_service_bus_related import RelatedAzureServiceBus # ============================================================================= # FLAT ASSET CLASS @@ -619,33 +619,36 @@ def _azure_service_bus_from_nested(nested: AzureServiceBusNested) -> AzureServic _AZURE_SERVICE_BUS_REL_FIELDS, AzureServiceBusRelationshipAttributes, ) - return AzureServiceBus( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_azure_service_bus_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_azure_service_bus_attrs(attrs)) + kwargs.update(merged_rels) + return AzureServiceBus(**kwargs) def _azure_service_bus_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/azure_service_bus_namespace.py b/pyatlan_v9/model/assets/azure_service_bus_namespace.py index de500caf0..3e01a5424 100644 --- a/pyatlan_v9/model/assets/azure_service_bus_namespace.py +++ b/pyatlan_v9/model/assets/azure_service_bus_namespace.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,10 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .azure_service_bus_related import ( + RelatedAzureServiceBusNamespace, + RelatedAzureServiceBusTopic, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,17 +57,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .azure_service_bus_related import ( - RelatedAzureServiceBusNamespace, - RelatedAzureServiceBusTopic, -) # ============================================================================= # FLAT ASSET CLASS @@ -640,33 +640,36 @@ def _azure_service_bus_namespace_from_nested( _AZURE_SERVICE_BUS_NAMESPACE_REL_FIELDS, AzureServiceBusNamespaceRelationshipAttributes, ) - return AzureServiceBusNamespace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_azure_service_bus_namespace_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_azure_service_bus_namespace_attrs(attrs)) + kwargs.update(merged_rels) + return AzureServiceBusNamespace(**kwargs) def _azure_service_bus_namespace_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/azure_service_bus_schema.py b/pyatlan_v9/model/assets/azure_service_bus_schema.py index 09ea7a3ce..68f37529e 100644 --- a/pyatlan_v9/model/assets/azure_service_bus_schema.py +++ b/pyatlan_v9/model/assets/azure_service_bus_schema.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,10 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .azure_service_bus_related import ( + RelatedAzureServiceBusSchema, + RelatedAzureServiceBusTopic, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,17 +57,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .azure_service_bus_related import ( - RelatedAzureServiceBusSchema, - RelatedAzureServiceBusTopic, -) # ============================================================================= # FLAT ASSET CLASS @@ -638,33 +638,36 @@ def _azure_service_bus_schema_from_nested( _AZURE_SERVICE_BUS_SCHEMA_REL_FIELDS, AzureServiceBusSchemaRelationshipAttributes, ) - return AzureServiceBusSchema( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_azure_service_bus_schema_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_azure_service_bus_schema_attrs(attrs)) + kwargs.update(merged_rels) + return AzureServiceBusSchema(**kwargs) def _azure_service_bus_schema_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/azure_service_bus_topic.py b/pyatlan_v9/model/assets/azure_service_bus_topic.py index 70a4f57c1..64d497b60 100644 --- a/pyatlan_v9/model/assets/azure_service_bus_topic.py +++ b/pyatlan_v9/model/assets/azure_service_bus_topic.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .azure_service_bus_related import ( + RelatedAzureServiceBusNamespace, + RelatedAzureServiceBusSchema, + RelatedAzureServiceBusTopic, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .azure_service_bus_related import ( - RelatedAzureServiceBusNamespace, - RelatedAzureServiceBusSchema, - RelatedAzureServiceBusTopic, -) # ============================================================================= # FLAT ASSET CLASS @@ -672,33 +672,36 @@ def _azure_service_bus_topic_from_nested( _AZURE_SERVICE_BUS_TOPIC_REL_FIELDS, AzureServiceBusTopicRelationshipAttributes, ) - return AzureServiceBusTopic( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_azure_service_bus_topic_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_azure_service_bus_topic_attrs(attrs)) + kwargs.update(merged_rels) + return AzureServiceBusTopic(**kwargs) def _azure_service_bus_topic_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/bi.py b/pyatlan_v9/model/assets/bi.py index ccc20bf2b..301af6668 100644 --- a/pyatlan_v9/model/assets/bi.py +++ b/pyatlan_v9/model/assets/bi.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .catalog_related import RelatedBI from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .catalog_related import RelatedBI # ============================================================================= # FLAT ASSET CLASS @@ -566,33 +566,36 @@ def _bi_from_nested(nested: BINested) -> BI: _BI_REL_FIELDS, BIRelationshipAttributes, ) - return BI( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_bi_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_bi_attrs(attrs)) + kwargs.update(merged_rels) + return BI(**kwargs) def _bi_to_nested_bytes(bi: BI, serde: Serde) -> bytes: @@ -609,10 +612,7 @@ def _bi_from_nested_bytes(data: bytes, serde: Serde) -> BI: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 BI.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") BI.INPUT_TO_AIRFLOW_TASKS = RelationField("inputToAirflowTasks") diff --git a/pyatlan_v9/model/assets/bi_process.py b/pyatlan_v9/model/assets/bi_process.py index f9696b88b..2602163c5 100644 --- a/pyatlan_v9/model/assets/bi_process.py +++ b/pyatlan_v9/model/assets/bi_process.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .adf_related import RelatedAdfActivity from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -47,20 +54,13 @@ from .matillion_related import RelatedMatillionComponent from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .power_bi_related import RelatedPowerBIDataflow +from .process_related import RelatedBIProcess, RelatedColumnProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedFunction, RelatedProcedure -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .process_related import RelatedBIProcess, RelatedColumnProcess # ============================================================================= # FLAT ASSET CLASS @@ -678,33 +678,36 @@ def _bi_process_from_nested(nested: BIProcessNested) -> BIProcess: _BI_PROCESS_REL_FIELDS, BIProcessRelationshipAttributes, ) - return BIProcess( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_bi_process_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_bi_process_attrs(attrs)) + kwargs.update(merged_rels) + return BIProcess(**kwargs) def _bi_process_to_nested_bytes(bi_process: BIProcess, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/bigquery_routine.py b/pyatlan_v9/model/assets/bigquery_routine.py index c0f322101..c27a63b7a 100644 --- a/pyatlan_v9/model/assets/bigquery_routine.py +++ b/pyatlan_v9/model/assets/bigquery_routine.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .bigquery_related import RelatedBigqueryRoutine from .context_related import RelatedContextRepository from .cosmos_mongo_db_related import RelatedCosmosMongoDBCollection from .data_contract_related import RelatedDataContract @@ -61,14 +69,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .bigquery_related import RelatedBigqueryRoutine # ============================================================================= # FLAT ASSET CLASS @@ -1235,33 +1235,36 @@ def _bigquery_routine_from_nested(nested: BigqueryRoutineNested) -> BigqueryRout _BIGQUERY_ROUTINE_REL_FIELDS, BigqueryRoutineRelationshipAttributes, ) - return BigqueryRoutine( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_bigquery_routine_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_bigquery_routine_attrs(attrs)) + kwargs.update(merged_rels) + return BigqueryRoutine(**kwargs) def _bigquery_routine_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/business_policy.py b/pyatlan_v9/model/assets/business_policy.py index 40efc0b03..ab32aba6f 100644 --- a/pyatlan_v9/model/assets/business_policy.py +++ b/pyatlan_v9/model/assets/business_policy.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -30,6 +37,10 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .business_policy_related import ( + RelatedBusinessPolicy, + RelatedBusinessPolicyException, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -42,17 +53,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .business_policy_related import ( - RelatedBusinessPolicy, - RelatedBusinessPolicyException, -) # ============================================================================= # FLAT ASSET CLASS @@ -612,33 +612,36 @@ def _business_policy_from_nested(nested: BusinessPolicyNested) -> BusinessPolicy _BUSINESS_POLICY_REL_FIELDS, BusinessPolicyRelationshipAttributes, ) - return BusinessPolicy( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_business_policy_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_business_policy_attrs(attrs)) + kwargs.update(merged_rels) + return BusinessPolicy(**kwargs) def _business_policy_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/calculation_view.py b/pyatlan_v9/model/assets/calculation_view.py index 87854a3a1..2ddfad78a 100644 --- a/pyatlan_v9/model/assets/calculation_view.py +++ b/pyatlan_v9/model/assets/calculation_view.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -59,13 +66,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sql_related import RelatedCalculationView, RelatedColumn, RelatedSchema # ============================================================================= @@ -1095,33 +1095,36 @@ def _calculation_view_from_nested(nested: CalculationViewNested) -> CalculationV _CALCULATION_VIEW_REL_FIELDS, CalculationViewRelationshipAttributes, ) - return CalculationView( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_calculation_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_calculation_view_attrs(attrs)) + kwargs.update(merged_rels) + return CalculationView(**kwargs) def _calculation_view_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cassandra.py b/pyatlan_v9/model/assets/cassandra.py index 59c6264b5..da39530dc 100644 --- a/pyatlan_v9/model/assets/cassandra.py +++ b/pyatlan_v9/model/assets/cassandra.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cassandra_related import RelatedCassandra from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cassandra_related import RelatedCassandra # ============================================================================= # FLAT ASSET CLASS @@ -631,33 +631,36 @@ def _cassandra_from_nested(nested: CassandraNested) -> Cassandra: _CASSANDRA_REL_FIELDS, CassandraRelationshipAttributes, ) - return Cassandra( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cassandra_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cassandra_attrs(attrs)) + kwargs.update(merged_rels) + return Cassandra(**kwargs) def _cassandra_to_nested_bytes(cassandra: Cassandra, serde: Serde) -> bytes: @@ -674,10 +677,7 @@ def _cassandra_from_nested_bytes(data: bytes, serde: Serde) -> Cassandra: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Cassandra.CASSANDRA_KEYSPACE_NAME = KeywordField( "cassandraKeyspaceName", "cassandraKeyspaceName" diff --git a/pyatlan_v9/model/assets/cassandra_column.py b/pyatlan_v9/model/assets/cassandra_column.py index 5ca592cdc..cbf8806ae 100644 --- a/pyatlan_v9/model/assets/cassandra_column.py +++ b/pyatlan_v9/model/assets/cassandra_column.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cassandra_related import ( + RelatedCassandraColumn, + RelatedCassandraTable, + RelatedCassandraView, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -48,18 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cassandra_related import ( - RelatedCassandraColumn, - RelatedCassandraTable, - RelatedCassandraView, -) # ============================================================================= # FLAT ASSET CLASS @@ -753,33 +753,36 @@ def _cassandra_column_from_nested(nested: CassandraColumnNested) -> CassandraCol _CASSANDRA_COLUMN_REL_FIELDS, CassandraColumnRelationshipAttributes, ) - return CassandraColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cassandra_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cassandra_column_attrs(attrs)) + kwargs.update(merged_rels) + return CassandraColumn(**kwargs) def _cassandra_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cassandra_index.py b/pyatlan_v9/model/assets/cassandra_index.py index 41461dd6b..8ea15ceb8 100644 --- a/pyatlan_v9/model/assets/cassandra_index.py +++ b/pyatlan_v9/model/assets/cassandra_index.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cassandra_related import RelatedCassandraIndex, RelatedCassandraTable from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -48,14 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cassandra_related import RelatedCassandraIndex, RelatedCassandraTable # ============================================================================= # FLAT ASSET CLASS @@ -695,33 +695,36 @@ def _cassandra_index_from_nested(nested: CassandraIndexNested) -> CassandraIndex _CASSANDRA_INDEX_REL_FIELDS, CassandraIndexRelationshipAttributes, ) - return CassandraIndex( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cassandra_index_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cassandra_index_attrs(attrs)) + kwargs.update(merged_rels) + return CassandraIndex(**kwargs) def _cassandra_index_to_nested_bytes( @@ -740,10 +743,7 @@ def _cassandra_index_from_nested_bytes(data: bytes, serde: Serde) -> CassandraIn # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 CassandraIndex.CASSANDRA_INDEX_KIND = KeywordField( "cassandraIndexKind", "cassandraIndexKind" diff --git a/pyatlan_v9/model/assets/cassandra_keyspace.py b/pyatlan_v9/model/assets/cassandra_keyspace.py index 2fc4d4633..45f2e385b 100644 --- a/pyatlan_v9/model/assets/cassandra_keyspace.py +++ b/pyatlan_v9/model/assets/cassandra_keyspace.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cassandra_related import ( + RelatedCassandraKeyspace, + RelatedCassandraTable, + RelatedCassandraView, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cassandra_related import ( - RelatedCassandraKeyspace, - RelatedCassandraTable, - RelatedCassandraView, -) # ============================================================================= # FLAT ASSET CLASS @@ -703,33 +703,36 @@ def _cassandra_keyspace_from_nested( _CASSANDRA_KEYSPACE_REL_FIELDS, CassandraKeyspaceRelationshipAttributes, ) - return CassandraKeyspace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cassandra_keyspace_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cassandra_keyspace_attrs(attrs)) + kwargs.update(merged_rels) + return CassandraKeyspace(**kwargs) def _cassandra_keyspace_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cassandra_table.py b/pyatlan_v9/model/assets/cassandra_table.py index fac5311be..b84639499 100644 --- a/pyatlan_v9/model/assets/cassandra_table.py +++ b/pyatlan_v9/model/assets/cassandra_table.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,12 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cassandra_related import ( + RelatedCassandraColumn, + RelatedCassandraIndex, + RelatedCassandraKeyspace, + RelatedCassandraTable, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -48,19 +61,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cassandra_related import ( - RelatedCassandraColumn, - RelatedCassandraIndex, - RelatedCassandraKeyspace, - RelatedCassandraTable, -) # ============================================================================= # FLAT ASSET CLASS @@ -885,33 +885,36 @@ def _cassandra_table_from_nested(nested: CassandraTableNested) -> CassandraTable _CASSANDRA_TABLE_REL_FIELDS, CassandraTableRelationshipAttributes, ) - return CassandraTable( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cassandra_table_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cassandra_table_attrs(attrs)) + kwargs.update(merged_rels) + return CassandraTable(**kwargs) def _cassandra_table_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cassandra_view.py b/pyatlan_v9/model/assets/cassandra_view.py index 87b011f6f..0840314c1 100644 --- a/pyatlan_v9/model/assets/cassandra_view.py +++ b/pyatlan_v9/model/assets/cassandra_view.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cassandra_related import ( + RelatedCassandraColumn, + RelatedCassandraKeyspace, + RelatedCassandraView, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -48,18 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cassandra_related import ( - RelatedCassandraColumn, - RelatedCassandraKeyspace, - RelatedCassandraView, -) # ============================================================================= # FLAT ASSET CLASS @@ -869,33 +869,36 @@ def _cassandra_view_from_nested(nested: CassandraViewNested) -> CassandraView: _CASSANDRA_VIEW_REL_FIELDS, CassandraViewRelationshipAttributes, ) - return CassandraView( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cassandra_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cassandra_view_attrs(attrs)) + kwargs.update(merged_rels) + return CassandraView(**kwargs) def _cassandra_view_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/catalog.py b/pyatlan_v9/model/assets/catalog.py index 9cc0542de..e1df17697 100644 --- a/pyatlan_v9/model/assets/catalog.py +++ b/pyatlan_v9/model/assets/catalog.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .catalog_related import RelatedCatalog from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .catalog_related import RelatedCatalog # ============================================================================= # FLAT ASSET CLASS @@ -570,33 +570,36 @@ def _catalog_from_nested(nested: CatalogNested) -> Catalog: _CATALOG_REL_FIELDS, CatalogRelationshipAttributes, ) - return Catalog( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_catalog_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_catalog_attrs(attrs)) + kwargs.update(merged_rels) + return Catalog(**kwargs) def _catalog_to_nested_bytes(catalog: Catalog, serde: Serde) -> bytes: @@ -613,10 +616,7 @@ def _catalog_from_nested_bytes(data: bytes, serde: Serde) -> Catalog: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Catalog.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") Catalog.INPUT_TO_AIRFLOW_TASKS = RelationField("inputToAirflowTasks") diff --git a/pyatlan_v9/model/assets/cloud.py b/pyatlan_v9/model/assets/cloud.py index a6050a571..0c5f36d13 100644 --- a/pyatlan_v9/model/assets/cloud.py +++ b/pyatlan_v9/model/assets/cloud.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -29,6 +36,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cloud_related import RelatedCloud from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -41,14 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cloud_related import RelatedCloud # ============================================================================= # FLAT ASSET CLASS @@ -481,33 +481,36 @@ def _cloud_from_nested(nested: CloudNested) -> Cloud: _CLOUD_REL_FIELDS, CloudRelationshipAttributes, ) - return Cloud( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cloud_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cloud_attrs(attrs)) + kwargs.update(merged_rels) + return Cloud(**kwargs) def _cloud_to_nested_bytes(cloud: Cloud, serde: Serde) -> bytes: @@ -524,10 +527,7 @@ def _cloud_from_nested_bytes(data: bytes, serde: Serde) -> Cloud: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Cloud.CLOUD_UNIFORM_RESOURCE_NAME = KeywordField( "cloudUniformResourceName", "cloudUniformResourceName" diff --git a/pyatlan_v9/model/assets/cognite.py b/pyatlan_v9/model/assets/cognite.py index a56d273b8..cbd1892f7 100644 --- a/pyatlan_v9/model/assets/cognite.py +++ b/pyatlan_v9/model/assets/cognite.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognite_related import RelatedCognite from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognite_related import RelatedCognite # ============================================================================= # FLAT ASSET CLASS @@ -570,33 +570,36 @@ def _cognite_from_nested(nested: CogniteNested) -> Cognite: _COGNITE_REL_FIELDS, CogniteRelationshipAttributes, ) - return Cognite( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognite_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognite_attrs(attrs)) + kwargs.update(merged_rels) + return Cognite(**kwargs) def _cognite_to_nested_bytes(cognite: Cognite, serde: Serde) -> bytes: @@ -613,10 +616,7 @@ def _cognite_from_nested_bytes(data: bytes, serde: Serde) -> Cognite: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Cognite.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") Cognite.INPUT_TO_AIRFLOW_TASKS = RelationField("inputToAirflowTasks") diff --git a/pyatlan_v9/model/assets/cognite3d_model.py b/pyatlan_v9/model/assets/cognite3d_model.py index 587bca237..8279e3412 100644 --- a/pyatlan_v9/model/assets/cognite3d_model.py +++ b/pyatlan_v9/model/assets/cognite3d_model.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognite_related import RelatedCognite3DModel, RelatedCogniteAsset from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognite_related import RelatedCognite3DModel, RelatedCogniteAsset # ============================================================================= # FLAT ASSET CLASS @@ -601,33 +601,36 @@ def _cognite3d_model_from_nested(nested: Cognite3DModelNested) -> Cognite3DModel _COGNITE3D_MODEL_REL_FIELDS, Cognite3DModelRelationshipAttributes, ) - return Cognite3DModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognite3d_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognite3d_model_attrs(attrs)) + kwargs.update(merged_rels) + return Cognite3DModel(**kwargs) def _cognite3d_model_to_nested_bytes( @@ -646,10 +649,7 @@ def _cognite3d_model_from_nested_bytes(data: bytes, serde: Serde) -> Cognite3DMo # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Cognite3DModel.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/cognite_asset.py b/pyatlan_v9/model/assets/cognite_asset.py index cc557375f..aca1e44df 100644 --- a/pyatlan_v9/model/assets/cognite_asset.py +++ b/pyatlan_v9/model/assets/cognite_asset.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,14 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognite_related import ( + RelatedCognite3DModel, + RelatedCogniteAsset, + RelatedCogniteEvent, + RelatedCogniteFile, + RelatedCogniteSequence, + RelatedCogniteTimeSeries, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,21 +61,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognite_related import ( - RelatedCognite3DModel, - RelatedCogniteAsset, - RelatedCogniteEvent, - RelatedCogniteFile, - RelatedCogniteSequence, - RelatedCogniteTimeSeries, -) # ============================================================================= # FLAT ASSET CLASS @@ -625,33 +625,36 @@ def _cognite_asset_from_nested(nested: CogniteAssetNested) -> CogniteAsset: _COGNITE_ASSET_REL_FIELDS, CogniteAssetRelationshipAttributes, ) - return CogniteAsset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognite_asset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognite_asset_attrs(attrs)) + kwargs.update(merged_rels) + return CogniteAsset(**kwargs) def _cognite_asset_to_nested_bytes(cognite_asset: CogniteAsset, serde: Serde) -> bytes: @@ -668,10 +671,7 @@ def _cognite_asset_from_nested_bytes(data: bytes, serde: Serde) -> CogniteAsset: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 CogniteAsset.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/cognite_event.py b/pyatlan_v9/model/assets/cognite_event.py index a3bd36b93..51da78dbc 100644 --- a/pyatlan_v9/model/assets/cognite_event.py +++ b/pyatlan_v9/model/assets/cognite_event.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognite_related import RelatedCogniteAsset, RelatedCogniteEvent from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognite_related import RelatedCogniteAsset, RelatedCogniteEvent # ============================================================================= # FLAT ASSET CLASS @@ -599,33 +599,36 @@ def _cognite_event_from_nested(nested: CogniteEventNested) -> CogniteEvent: _COGNITE_EVENT_REL_FIELDS, CogniteEventRelationshipAttributes, ) - return CogniteEvent( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognite_event_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognite_event_attrs(attrs)) + kwargs.update(merged_rels) + return CogniteEvent(**kwargs) def _cognite_event_to_nested_bytes(cognite_event: CogniteEvent, serde: Serde) -> bytes: @@ -642,10 +645,7 @@ def _cognite_event_from_nested_bytes(data: bytes, serde: Serde) -> CogniteEvent: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 CogniteEvent.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/cognite_file.py b/pyatlan_v9/model/assets/cognite_file.py index 4f8ff1633..6a8df5fea 100644 --- a/pyatlan_v9/model/assets/cognite_file.py +++ b/pyatlan_v9/model/assets/cognite_file.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognite_related import RelatedCogniteAsset, RelatedCogniteFile from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognite_related import RelatedCogniteAsset, RelatedCogniteFile # ============================================================================= # FLAT ASSET CLASS @@ -595,33 +595,36 @@ def _cognite_file_from_nested(nested: CogniteFileNested) -> CogniteFile: _COGNITE_FILE_REL_FIELDS, CogniteFileRelationshipAttributes, ) - return CogniteFile( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognite_file_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognite_file_attrs(attrs)) + kwargs.update(merged_rels) + return CogniteFile(**kwargs) def _cognite_file_to_nested_bytes(cognite_file: CogniteFile, serde: Serde) -> bytes: @@ -638,10 +641,7 @@ def _cognite_file_from_nested_bytes(data: bytes, serde: Serde) -> CogniteFile: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 CogniteFile.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/cognite_related.py b/pyatlan_v9/model/assets/cognite_related.py index 223098075..b20cc5ce2 100644 --- a/pyatlan_v9/model/assets/cognite_related.py +++ b/pyatlan_v9/model/assets/cognite_related.py @@ -11,7 +11,6 @@ from __future__ import annotations - from msgspec import UNSET from .catalog_related import RelatedSaaS diff --git a/pyatlan_v9/model/assets/cognite_sequence.py b/pyatlan_v9/model/assets/cognite_sequence.py index 9ab82726a..e56a433db 100644 --- a/pyatlan_v9/model/assets/cognite_sequence.py +++ b/pyatlan_v9/model/assets/cognite_sequence.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognite_related import RelatedCogniteAsset, RelatedCogniteSequence from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognite_related import RelatedCogniteAsset, RelatedCogniteSequence # ============================================================================= # FLAT ASSET CLASS @@ -605,33 +605,36 @@ def _cognite_sequence_from_nested(nested: CogniteSequenceNested) -> CogniteSeque _COGNITE_SEQUENCE_REL_FIELDS, CogniteSequenceRelationshipAttributes, ) - return CogniteSequence( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognite_sequence_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognite_sequence_attrs(attrs)) + kwargs.update(merged_rels) + return CogniteSequence(**kwargs) def _cognite_sequence_to_nested_bytes( @@ -650,10 +653,7 @@ def _cognite_sequence_from_nested_bytes(data: bytes, serde: Serde) -> CogniteSeq # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 CogniteSequence.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/cognite_time_series.py b/pyatlan_v9/model/assets/cognite_time_series.py index 8b7cb77c8..bcf544724 100644 --- a/pyatlan_v9/model/assets/cognite_time_series.py +++ b/pyatlan_v9/model/assets/cognite_time_series.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognite_related import RelatedCogniteAsset, RelatedCogniteTimeSeries from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognite_related import RelatedCogniteAsset, RelatedCogniteTimeSeries # ============================================================================= # FLAT ASSET CLASS @@ -607,33 +607,36 @@ def _cognite_time_series_from_nested( _COGNITE_TIME_SERIES_REL_FIELDS, CogniteTimeSeriesRelationshipAttributes, ) - return CogniteTimeSeries( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognite_time_series_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognite_time_series_attrs(attrs)) + kwargs.update(merged_rels) + return CogniteTimeSeries(**kwargs) def _cognite_time_series_to_nested_bytes( @@ -654,10 +657,7 @@ def _cognite_time_series_from_nested_bytes( # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 CogniteTimeSeries.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/cognos.py b/pyatlan_v9/model/assets/cognos.py index 045cbcc4b..9cdc43b38 100644 --- a/pyatlan_v9/model/assets/cognos.py +++ b/pyatlan_v9/model/assets/cognos.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import RelatedCognos from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import RelatedCognos # ============================================================================= # FLAT ASSET CLASS @@ -651,33 +651,36 @@ def _cognos_from_nested(nested: CognosNested) -> Cognos: _COGNOS_REL_FIELDS, CognosRelationshipAttributes, ) - return Cognos( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_attrs(attrs)) + kwargs.update(merged_rels) + return Cognos(**kwargs) def _cognos_to_nested_bytes(cognos: Cognos, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/cognos_column.py b/pyatlan_v9/model/assets/cognos_column.py index 0efc704af..3f5a65b10 100644 --- a/pyatlan_v9/model/assets/cognos_column.py +++ b/pyatlan_v9/model/assets/cognos_column.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,15 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import ( + RelatedCognosColumn, + RelatedCognosDashboard, + RelatedCognosDataset, + RelatedCognosExploration, + RelatedCognosFile, + RelatedCognosModule, + RelatedCognosPackage, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,22 +63,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import ( - RelatedCognosColumn, - RelatedCognosDashboard, - RelatedCognosDataset, - RelatedCognosExploration, - RelatedCognosFile, - RelatedCognosModule, - RelatedCognosPackage, -) # ============================================================================= # FLAT ASSET CLASS @@ -757,33 +757,36 @@ def _cognos_column_from_nested(nested: CognosColumnNested) -> CognosColumn: _COGNOS_COLUMN_REL_FIELDS, CognosColumnRelationshipAttributes, ) - return CognosColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_column_attrs(attrs)) + kwargs.update(merged_rels) + return CognosColumn(**kwargs) def _cognos_column_to_nested_bytes(cognos_column: CognosColumn, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/cognos_dashboard.py b/pyatlan_v9/model/assets/cognos_dashboard.py index f32286646..986425d7b 100644 --- a/pyatlan_v9/model/assets/cognos_dashboard.py +++ b/pyatlan_v9/model/assets/cognos_dashboard.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import ( + RelatedCognosColumn, + RelatedCognosDashboard, + RelatedCognosFolder, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import ( - RelatedCognosColumn, - RelatedCognosDashboard, - RelatedCognosFolder, -) # ============================================================================= # FLAT ASSET CLASS @@ -700,33 +700,36 @@ def _cognos_dashboard_from_nested(nested: CognosDashboardNested) -> CognosDashbo _COGNOS_DASHBOARD_REL_FIELDS, CognosDashboardRelationshipAttributes, ) - return CognosDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return CognosDashboard(**kwargs) def _cognos_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cognos_dataset.py b/pyatlan_v9/model/assets/cognos_dataset.py index f223eac9d..893de18e0 100644 --- a/pyatlan_v9/model/assets/cognos_dataset.py +++ b/pyatlan_v9/model/assets/cognos_dataset.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import ( + RelatedCognosColumn, + RelatedCognosDataset, + RelatedCognosFolder, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import ( - RelatedCognosColumn, - RelatedCognosDataset, - RelatedCognosFolder, -) # ============================================================================= # FLAT ASSET CLASS @@ -694,33 +694,36 @@ def _cognos_dataset_from_nested(nested: CognosDatasetNested) -> CognosDataset: _COGNOS_DATASET_REL_FIELDS, CognosDatasetRelationshipAttributes, ) - return CognosDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return CognosDataset(**kwargs) def _cognos_dataset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cognos_datasource.py b/pyatlan_v9/model/assets/cognos_datasource.py index 09056c096..32040741c 100644 --- a/pyatlan_v9/model/assets/cognos_datasource.py +++ b/pyatlan_v9/model/assets/cognos_datasource.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import RelatedCognosDatasource from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import RelatedCognosDatasource # ============================================================================= # FLAT ASSET CLASS @@ -676,33 +676,36 @@ def _cognos_datasource_from_nested(nested: CognosDatasourceNested) -> CognosData _COGNOS_DATASOURCE_REL_FIELDS, CognosDatasourceRelationshipAttributes, ) - return CognosDatasource( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_datasource_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_datasource_attrs(attrs)) + kwargs.update(merged_rels) + return CognosDatasource(**kwargs) def _cognos_datasource_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cognos_exploration.py b/pyatlan_v9/model/assets/cognos_exploration.py index 5b5128b84..d67356ef1 100644 --- a/pyatlan_v9/model/assets/cognos_exploration.py +++ b/pyatlan_v9/model/assets/cognos_exploration.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import ( + RelatedCognosColumn, + RelatedCognosExploration, + RelatedCognosFolder, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import ( - RelatedCognosColumn, - RelatedCognosExploration, - RelatedCognosFolder, -) # ============================================================================= # FLAT ASSET CLASS @@ -702,33 +702,36 @@ def _cognos_exploration_from_nested( _COGNOS_EXPLORATION_REL_FIELDS, CognosExplorationRelationshipAttributes, ) - return CognosExploration( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_exploration_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_exploration_attrs(attrs)) + kwargs.update(merged_rels) + return CognosExploration(**kwargs) def _cognos_exploration_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cognos_file.py b/pyatlan_v9/model/assets/cognos_file.py index 577237a35..b2371e1e7 100644 --- a/pyatlan_v9/model/assets/cognos_file.py +++ b/pyatlan_v9/model/assets/cognos_file.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import RelatedCognosColumn, RelatedCognosFile, RelatedCognosFolder from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import RelatedCognosColumn, RelatedCognosFile, RelatedCognosFolder # ============================================================================= # FLAT ASSET CLASS @@ -684,33 +684,36 @@ def _cognos_file_from_nested(nested: CognosFileNested) -> CognosFile: _COGNOS_FILE_REL_FIELDS, CognosFileRelationshipAttributes, ) - return CognosFile( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_file_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_file_attrs(attrs)) + kwargs.update(merged_rels) + return CognosFile(**kwargs) def _cognos_file_to_nested_bytes(cognos_file: CognosFile, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/cognos_folder.py b/pyatlan_v9/model/assets/cognos_folder.py index f7bc1e082..6d693fef3 100644 --- a/pyatlan_v9/model/assets/cognos_folder.py +++ b/pyatlan_v9/model/assets/cognos_folder.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,16 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import ( + RelatedCognosDashboard, + RelatedCognosDataset, + RelatedCognosExploration, + RelatedCognosFile, + RelatedCognosFolder, + RelatedCognosModule, + RelatedCognosPackage, + RelatedCognosReport, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,23 +64,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import ( - RelatedCognosDashboard, - RelatedCognosDataset, - RelatedCognosExploration, - RelatedCognosFile, - RelatedCognosFolder, - RelatedCognosModule, - RelatedCognosPackage, - RelatedCognosReport, -) # ============================================================================= # FLAT ASSET CLASS @@ -771,33 +771,36 @@ def _cognos_folder_from_nested(nested: CognosFolderNested) -> CognosFolder: _COGNOS_FOLDER_REL_FIELDS, CognosFolderRelationshipAttributes, ) - return CognosFolder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_folder_attrs(attrs)) + kwargs.update(merged_rels) + return CognosFolder(**kwargs) def _cognos_folder_to_nested_bytes(cognos_folder: CognosFolder, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/cognos_module.py b/pyatlan_v9/model/assets/cognos_module.py index fc43f2d2a..47a2b6e1a 100644 --- a/pyatlan_v9/model/assets/cognos_module.py +++ b/pyatlan_v9/model/assets/cognos_module.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import ( + RelatedCognosColumn, + RelatedCognosFolder, + RelatedCognosModule, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import ( - RelatedCognosColumn, - RelatedCognosFolder, - RelatedCognosModule, -) # ============================================================================= # FLAT ASSET CLASS @@ -694,33 +694,36 @@ def _cognos_module_from_nested(nested: CognosModuleNested) -> CognosModule: _COGNOS_MODULE_REL_FIELDS, CognosModuleRelationshipAttributes, ) - return CognosModule( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_module_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_module_attrs(attrs)) + kwargs.update(merged_rels) + return CognosModule(**kwargs) def _cognos_module_to_nested_bytes(cognos_module: CognosModule, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/cognos_package.py b/pyatlan_v9/model/assets/cognos_package.py index 9172289f5..e7f2f39e6 100644 --- a/pyatlan_v9/model/assets/cognos_package.py +++ b/pyatlan_v9/model/assets/cognos_package.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,11 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import ( + RelatedCognosColumn, + RelatedCognosFolder, + RelatedCognosPackage, +) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import ( - RelatedCognosColumn, - RelatedCognosFolder, - RelatedCognosPackage, -) # ============================================================================= # FLAT ASSET CLASS @@ -694,33 +694,36 @@ def _cognos_package_from_nested(nested: CognosPackageNested) -> CognosPackage: _COGNOS_PACKAGE_REL_FIELDS, CognosPackageRelationshipAttributes, ) - return CognosPackage( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_package_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_package_attrs(attrs)) + kwargs.update(merged_rels) + return CognosPackage(**kwargs) def _cognos_package_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cognos_report.py b/pyatlan_v9/model/assets/cognos_report.py index fe3ce7a69..141efd27a 100644 --- a/pyatlan_v9/model/assets/cognos_report.py +++ b/pyatlan_v9/model/assets/cognos_report.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cognos_related import RelatedCognosFolder, RelatedCognosReport from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cognos_related import RelatedCognosFolder, RelatedCognosReport # ============================================================================= # FLAT ASSET CLASS @@ -682,33 +682,36 @@ def _cognos_report_from_nested(nested: CognosReportNested) -> CognosReport: _COGNOS_REPORT_REL_FIELDS, CognosReportRelationshipAttributes, ) - return CognosReport( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cognos_report_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cognos_report_attrs(attrs)) + kwargs.update(merged_rels) + return CognosReport(**kwargs) def _cognos_report_to_nested_bytes(cognos_report: CognosReport, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/collection.py b/pyatlan_v9/model/assets/collection.py index c65df5606..ac23bd53b 100644 --- a/pyatlan_v9/model/assets/collection.py +++ b/pyatlan_v9/model/assets/collection.py @@ -19,6 +19,15 @@ from msgspec import UNSET, UnsetType +from pyatlan.errors import AtlanError, ErrorCode +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -38,22 +47,12 @@ from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .namespace_related import RelatedCollection, RelatedFolder from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .sql_related import RelatedQuery -from pyatlan.errors import AtlanError -from pyatlan.errors import ErrorCode -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .namespace_related import RelatedCollection, RelatedFolder # ============================================================================= # FLAT ASSET CLASS @@ -533,33 +532,36 @@ def _collection_from_nested(nested: CollectionNested) -> Collection: _COLLECTION_REL_FIELDS, CollectionRelationshipAttributes, ) - return Collection( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_collection_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_collection_attrs(attrs)) + kwargs.update(merged_rels) + return Collection(**kwargs) def _collection_to_nested_bytes(collection: Collection, serde: Serde) -> bytes: @@ -576,10 +578,7 @@ def _collection_from_nested_bytes(data: bytes, serde: Serde) -> Collection: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Collection.ICON = KeywordField("icon", "icon") Collection.ICON_TYPE = KeywordField("iconType", "iconType") diff --git a/pyatlan_v9/model/assets/column.py b/pyatlan_v9/model/assets/column.py index d9d51e05a..ba56827e0 100644 --- a/pyatlan_v9/model/assets/column.py +++ b/pyatlan_v9/model/assets/column.py @@ -21,6 +21,16 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AtlanConnectorType +from pyatlan.utils import validate_required_fields +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -68,16 +78,6 @@ RelatedSqlInsightFilter, RelatedSqlInsightJoin, ) -from pyatlan.model.enums import AtlanConnectorType -from pyatlan.utils import validate_required_fields -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid - from .sql_related import ( RelatedCalculationView, RelatedColumn, @@ -2125,33 +2125,36 @@ def _column_from_nested(nested: ColumnNested) -> Column: _COLUMN_REL_FIELDS, ColumnRelationshipAttributes, ) - return Column( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_column_attrs(attrs)) + kwargs.update(merged_rels) + return Column(**kwargs) def _column_to_nested_bytes(column: Column, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/column_process.py b/pyatlan_v9/model/assets/column_process.py index 95aee60d2..0cc3d98d2 100644 --- a/pyatlan_v9/model/assets/column_process.py +++ b/pyatlan_v9/model/assets/column_process.py @@ -22,6 +22,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .adf_related import RelatedAdfActivity from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -50,21 +58,13 @@ from .matillion_related import RelatedMatillionComponent from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .power_bi_related import RelatedPowerBIDataflow +from .process_related import RelatedColumnProcess, RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedFunction, RelatedProcedure -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .process_related import RelatedColumnProcess, RelatedProcess # ============================================================================= # FLAT ASSET CLASS @@ -842,33 +842,36 @@ def _column_process_from_nested(nested: ColumnProcessNested) -> ColumnProcess: _COLUMN_PROCESS_REL_FIELDS, ColumnProcessRelationshipAttributes, ) - return ColumnProcess( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_column_process_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_column_process_attrs(attrs)) + kwargs.update(merged_rels) + return ColumnProcess(**kwargs) def _column_process_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/connection.py b/pyatlan_v9/model/assets/connection.py index 19ee77e99..5b905d9d3 100644 --- a/pyatlan_v9/model/assets/connection.py +++ b/pyatlan_v9/model/assets/connection.py @@ -15,12 +15,21 @@ from __future__ import annotations import re -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional +from typing import Any, ClassVar, Dict, List, Optional, Union import msgspec from msgspec import UNSET, UnsetType +from pyatlan.model.assets.connection import _validate_connector_type_value +from pyatlan.model.enums import AtlanConnectorType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -32,6 +41,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .connection_related import RelatedConnection from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -45,17 +55,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan.model.assets.connection import _validate_connector_type_value -from pyatlan.model.enums import AtlanConnectorType -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .connection_related import RelatedConnection # ============================================================================= # FLAT ASSET CLASS @@ -1079,33 +1078,36 @@ def _connection_from_nested(nested: ConnectionNested) -> Connection: _CONNECTION_REL_FIELDS, ConnectionRelationshipAttributes, ) - return Connection( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_connection_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_connection_attrs(attrs)) + kwargs.update(merged_rels) + return Connection(**kwargs) def _connection_to_nested_bytes(connection: Connection, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/context.py b/pyatlan_v9/model/assets/context.py index 7b59dc93d..732fb6d00 100644 --- a/pyatlan_v9/model/assets/context.py +++ b/pyatlan_v9/model/assets/context.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .context_related import RelatedContext, RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -45,14 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .context_related import RelatedContext, RelatedContextRepository # ============================================================================= # FLAT ASSET CLASS @@ -598,33 +598,36 @@ def _context_from_nested(nested: ContextNested) -> Context: _CONTEXT_REL_FIELDS, ContextRelationshipAttributes, ) - return Context( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_context_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_context_attrs(attrs)) + kwargs.update(merged_rels) + return Context(**kwargs) def _context_to_nested_bytes(context: Context, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/context_artifact.py b/pyatlan_v9/model/assets/context_artifact.py index bd6583874..4c1834903 100644 --- a/pyatlan_v9/model/assets/context_artifact.py +++ b/pyatlan_v9/model/assets/context_artifact.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .context_related import RelatedContextArtifact, RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .context_related import RelatedContextArtifact, RelatedContextRepository # ============================================================================= # FLAT ASSET CLASS @@ -711,33 +711,36 @@ def _context_artifact_from_nested(nested: ContextArtifactNested) -> ContextArtif _CONTEXT_ARTIFACT_REL_FIELDS, ContextArtifactRelationshipAttributes, ) - return ContextArtifact( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_context_artifact_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_context_artifact_attrs(attrs)) + kwargs.update(merged_rels) + return ContextArtifact(**kwargs) def _context_artifact_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/context_repository.py b/pyatlan_v9/model/assets/context_repository.py index ac0ea40fc..5749d4f17 100644 --- a/pyatlan_v9/model/assets/context_repository.py +++ b/pyatlan_v9/model/assets/context_repository.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .agent_related import RelatedAgent from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -32,6 +39,7 @@ _populate_asset_attrs, ) from .asset_related import RelatedAsset +from .context_related import RelatedContextArtifact, RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -48,14 +56,6 @@ from .skill_related import RelatedSkill from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .context_related import RelatedContextArtifact, RelatedContextRepository # ============================================================================= # FLAT ASSET CLASS @@ -690,33 +690,36 @@ def _context_repository_from_nested( _CONTEXT_REPOSITORY_REL_FIELDS, ContextRepositoryRelationshipAttributes, ) - return ContextRepository( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_context_repository_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_context_repository_attrs(attrs)) + kwargs.update(merged_rels) + return ContextRepository(**kwargs) def _context_repository_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cosmos_mongo_db.py b/pyatlan_v9/model/assets/cosmos_mongo_db.py index 777c84f81..7f2569022 100644 --- a/pyatlan_v9/model/assets/cosmos_mongo_db.py +++ b/pyatlan_v9/model/assets/cosmos_mongo_db.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,7 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .cosmos_mongo_db_related import RelatedCosmosMongoDB from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cosmos_mongo_db_related import RelatedCosmosMongoDB # ============================================================================= # FLAT ASSET CLASS @@ -594,33 +594,36 @@ def _cosmos_mongo_db_from_nested(nested: CosmosMongoDBNested) -> CosmosMongoDB: _COSMOS_MONGO_DB_REL_FIELDS, CosmosMongoDBRelationshipAttributes, ) - return CosmosMongoDB( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cosmos_mongo_db_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cosmos_mongo_db_attrs(attrs)) + kwargs.update(merged_rels) + return CosmosMongoDB(**kwargs) def _cosmos_mongo_db_to_nested_bytes( @@ -639,10 +642,7 @@ def _cosmos_mongo_db_from_nested_bytes(data: bytes, serde: Serde) -> CosmosMongo # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 CosmosMongoDB.NO_SQL_SCHEMA_DEFINITION = KeywordField( "noSQLSchemaDefinition", "noSQLSchemaDefinition" diff --git a/pyatlan_v9/model/assets/cosmos_mongo_db_account.py b/pyatlan_v9/model/assets/cosmos_mongo_db_account.py index 64a754306..0e75da308 100644 --- a/pyatlan_v9/model/assets/cosmos_mongo_db_account.py +++ b/pyatlan_v9/model/assets/cosmos_mongo_db_account.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,10 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .cosmos_mongo_db_related import ( + RelatedCosmosMongoDBAccount, + RelatedCosmosMongoDBDatabase, +) from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -47,17 +58,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cosmos_mongo_db_related import ( - RelatedCosmosMongoDBAccount, - RelatedCosmosMongoDBDatabase, -) # ============================================================================= # FLAT ASSET CLASS @@ -889,33 +889,36 @@ def _cosmos_mongo_db_account_from_nested( _COSMOS_MONGO_DB_ACCOUNT_REL_FIELDS, CosmosMongoDBAccountRelationshipAttributes, ) - return CosmosMongoDBAccount( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cosmos_mongo_db_account_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cosmos_mongo_db_account_attrs(attrs)) + kwargs.update(merged_rels) + return CosmosMongoDBAccount(**kwargs) def _cosmos_mongo_db_account_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cosmos_mongo_db_collection.py b/pyatlan_v9/model/assets/cosmos_mongo_db_collection.py index c5dd3fd77..a336cb69f 100644 --- a/pyatlan_v9/model/assets/cosmos_mongo_db_collection.py +++ b/pyatlan_v9/model/assets/cosmos_mongo_db_collection.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -33,6 +40,10 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .cosmos_mongo_db_related import ( + RelatedCosmosMongoDBCollection, + RelatedCosmosMongoDBDatabase, +) from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -69,17 +80,6 @@ RelatedTable, RelatedTablePartition, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cosmos_mongo_db_related import ( - RelatedCosmosMongoDBCollection, - RelatedCosmosMongoDBDatabase, -) # ============================================================================= # FLAT ASSET CLASS @@ -1616,33 +1616,36 @@ def _cosmos_mongo_db_collection_from_nested( _COSMOS_MONGO_DB_COLLECTION_REL_FIELDS, CosmosMongoDBCollectionRelationshipAttributes, ) - return CosmosMongoDBCollection( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cosmos_mongo_db_collection_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cosmos_mongo_db_collection_attrs(attrs)) + kwargs.update(merged_rels) + return CosmosMongoDBCollection(**kwargs) def _cosmos_mongo_db_collection_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cosmos_mongo_db_database.py b/pyatlan_v9/model/assets/cosmos_mongo_db_database.py index d920dfaa2..1d24d87f9 100644 --- a/pyatlan_v9/model/assets/cosmos_mongo_db_database.py +++ b/pyatlan_v9/model/assets/cosmos_mongo_db_database.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -33,6 +40,11 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .cosmos_mongo_db_related import ( + RelatedCosmosMongoDBAccount, + RelatedCosmosMongoDBCollection, + RelatedCosmosMongoDBDatabase, +) from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -62,18 +74,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cosmos_mongo_db_related import ( - RelatedCosmosMongoDBAccount, - RelatedCosmosMongoDBCollection, - RelatedCosmosMongoDBDatabase, -) # ============================================================================= # FLAT ASSET CLASS @@ -1171,33 +1171,36 @@ def _cosmos_mongo_db_database_from_nested( _COSMOS_MONGO_DB_DATABASE_REL_FIELDS, CosmosMongoDBDatabaseRelationshipAttributes, ) - return CosmosMongoDBDatabase( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cosmos_mongo_db_database_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cosmos_mongo_db_database_attrs(attrs)) + kwargs.update(merged_rels) + return CosmosMongoDBDatabase(**kwargs) def _cosmos_mongo_db_database_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cube.py b/pyatlan_v9/model/assets/cube.py index b66e7b385..d14c94791 100644 --- a/pyatlan_v9/model/assets/cube.py +++ b/pyatlan_v9/model/assets/cube.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .cube_related import RelatedCube, RelatedCubeDimension from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cube_related import RelatedCube, RelatedCubeDimension # ============================================================================= # FLAT ASSET CLASS @@ -637,33 +637,36 @@ def _cube_from_nested(nested: CubeNested) -> Cube: _CUBE_REL_FIELDS, CubeRelationshipAttributes, ) - return Cube( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cube_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cube_attrs(attrs)) + kwargs.update(merged_rels) + return Cube(**kwargs) def _cube_to_nested_bytes(cube: Cube, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/cube_dimension.py b/pyatlan_v9/model/assets/cube_dimension.py index aebc9e132..80fd0b20d 100644 --- a/pyatlan_v9/model/assets/cube_dimension.py +++ b/pyatlan_v9/model/assets/cube_dimension.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,7 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .cube_related import RelatedCube, RelatedCubeDimension, RelatedCubeHierarchy from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cube_related import RelatedCube, RelatedCubeDimension, RelatedCubeHierarchy # ============================================================================= # FLAT ASSET CLASS @@ -674,33 +674,36 @@ def _cube_dimension_from_nested(nested: CubeDimensionNested) -> CubeDimension: _CUBE_DIMENSION_REL_FIELDS, CubeDimensionRelationshipAttributes, ) - return CubeDimension( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cube_dimension_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cube_dimension_attrs(attrs)) + kwargs.update(merged_rels) + return CubeDimension(**kwargs) def _cube_dimension_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/cube_field.py b/pyatlan_v9/model/assets/cube_field.py index fda184428..f062b8e9f 100644 --- a/pyatlan_v9/model/assets/cube_field.py +++ b/pyatlan_v9/model/assets/cube_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,7 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .cube_related import RelatedCubeField, RelatedCubeHierarchy from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cube_related import RelatedCubeField, RelatedCubeHierarchy # ============================================================================= # FLAT ASSET CLASS @@ -731,33 +731,36 @@ def _cube_field_from_nested(nested: CubeFieldNested) -> CubeField: _CUBE_FIELD_REL_FIELDS, CubeFieldRelationshipAttributes, ) - return CubeField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cube_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cube_field_attrs(attrs)) + kwargs.update(merged_rels) + return CubeField(**kwargs) def _cube_field_to_nested_bytes(cube_field: CubeField, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/cube_hierarchy.py b/pyatlan_v9/model/assets/cube_hierarchy.py index 3dc3702da..6d9a377e6 100644 --- a/pyatlan_v9/model/assets/cube_hierarchy.py +++ b/pyatlan_v9/model/assets/cube_hierarchy.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,7 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .cube_related import RelatedCubeDimension, RelatedCubeField, RelatedCubeHierarchy from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cube_related import RelatedCubeDimension, RelatedCubeField, RelatedCubeHierarchy # ============================================================================= # FLAT ASSET CLASS @@ -680,33 +680,36 @@ def _cube_hierarchy_from_nested(nested: CubeHierarchyNested) -> CubeHierarchy: _CUBE_HIERARCHY_REL_FIELDS, CubeHierarchyRelationshipAttributes, ) - return CubeHierarchy( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_cube_hierarchy_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_cube_hierarchy_attrs(attrs)) + kwargs.update(merged_rels) + return CubeHierarchy(**kwargs) def _cube_hierarchy_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/custom.py b/pyatlan_v9/model/assets/custom.py index ec2e8e1dc..3f35fa15c 100644 --- a/pyatlan_v9/model/assets/custom.py +++ b/pyatlan_v9/model/assets/custom.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .custom_related import RelatedCustom from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .custom_related import RelatedCustom # ============================================================================= # FLAT ASSET CLASS @@ -570,33 +570,36 @@ def _custom_from_nested(nested: CustomNested) -> Custom: _CUSTOM_REL_FIELDS, CustomRelationshipAttributes, ) - return Custom( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_custom_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_custom_attrs(attrs)) + kwargs.update(merged_rels) + return Custom(**kwargs) def _custom_to_nested_bytes(custom: Custom, serde: Serde) -> bytes: @@ -613,10 +616,7 @@ def _custom_from_nested_bytes(data: bytes, serde: Serde) -> Custom: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Custom.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") Custom.INPUT_TO_AIRFLOW_TASKS = RelationField("inputToAirflowTasks") diff --git a/pyatlan_v9/model/assets/custom_entity.py b/pyatlan_v9/model/assets/custom_entity.py index ee4fff7d3..14f1de871 100644 --- a/pyatlan_v9/model/assets/custom_entity.py +++ b/pyatlan_v9/model/assets/custom_entity.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +40,7 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .custom_related import RelatedCustomEntity from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -47,15 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .custom_related import RelatedCustomEntity # ============================================================================= # FLAT ASSET CLASS @@ -669,33 +669,36 @@ def _custom_entity_from_nested(nested: CustomEntityNested) -> CustomEntity: _CUSTOM_ENTITY_REL_FIELDS, CustomEntityRelationshipAttributes, ) - return CustomEntity( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_custom_entity_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_custom_entity_attrs(attrs)) + kwargs.update(merged_rels) + return CustomEntity(**kwargs) def _custom_entity_to_nested_bytes(custom_entity: CustomEntity, serde: Serde) -> bytes: @@ -712,10 +715,7 @@ def _custom_entity_from_nested_bytes(data: bytes, serde: Serde) -> CustomEntity: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 CustomEntity.CUSTOM_CHILDREN_SUBTYPE = KeywordField( "customChildrenSubtype", "customChildrenSubtype" diff --git a/pyatlan_v9/model/assets/data_contract.py b/pyatlan_v9/model/assets/data_contract.py index 45e55e5f5..5bbc768fa 100644 --- a/pyatlan_v9/model/assets/data_contract.py +++ b/pyatlan_v9/model/assets/data_contract.py @@ -15,11 +15,21 @@ from __future__ import annotations import re -from json import loads, JSONDecodeError +from json import JSONDecodeError, loads from typing import Any, ClassVar, List, Union from msgspec import UNSET, UnsetType +from pyatlan.errors import ErrorCode +from pyatlan_v9.model.contract import DataContractSpec +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +44,7 @@ ) from .asset_related import RelatedAsset from .context_related import RelatedContextRepository +from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType @@ -48,17 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.errors import ErrorCode -from pyatlan_v9.model.contract import DataContractSpec -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .data_contract_related import RelatedDataContract # ============================================================================= # FLAT ASSET CLASS @@ -720,33 +720,36 @@ def _data_contract_from_nested(nested: DataContractNested) -> DataContract: _DATA_CONTRACT_REL_FIELDS, DataContractRelationshipAttributes, ) - return DataContract( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_contract_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_contract_attrs(attrs)) + kwargs.update(merged_rels) + return DataContract(**kwargs) def _data_contract_to_nested_bytes(data_contract: DataContract, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/data_domain.py b/pyatlan_v9/model/assets/data_domain.py index b3b40fcc7..b93f5e6ed 100644 --- a/pyatlan_v9/model/assets/data_domain.py +++ b/pyatlan_v9/model/assets/data_domain.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -33,6 +41,7 @@ ) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract +from .data_mesh_related import RelatedDataDomain, RelatedDataProduct, RelatedStakeholder from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm @@ -46,15 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .data_mesh_related import RelatedDataDomain, RelatedDataProduct, RelatedStakeholder # ============================================================================= # FLAT ASSET CLASS @@ -684,33 +684,36 @@ def _data_domain_from_nested(nested: DataDomainNested) -> DataDomain: _DATA_DOMAIN_REL_FIELDS, DataDomainRelationshipAttributes, ) - return DataDomain( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_domain_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_domain_attrs(attrs)) + kwargs.update(merged_rels) + return DataDomain(**kwargs) def _data_domain_to_nested_bytes(data_domain: DataDomain, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/data_mesh.py b/pyatlan_v9/model/assets/data_mesh.py index 547c1d66a..6b3292f0b 100644 --- a/pyatlan_v9/model/assets/data_mesh.py +++ b/pyatlan_v9/model/assets/data_mesh.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -32,6 +39,7 @@ ) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract +from .data_mesh_related import RelatedDataMesh, RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm @@ -45,14 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .data_mesh_related import RelatedDataMesh, RelatedDataProduct # ============================================================================= # FLAT ASSET CLASS @@ -589,33 +589,36 @@ def _data_mesh_from_nested(nested: DataMeshNested) -> DataMesh: _DATA_MESH_REL_FIELDS, DataMeshRelationshipAttributes, ) - return DataMesh( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_mesh_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_mesh_attrs(attrs)) + kwargs.update(merged_rels) + return DataMesh(**kwargs) def _data_mesh_to_nested_bytes(data_mesh: DataMesh, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/data_mesh_dataset.py b/pyatlan_v9/model/assets/data_mesh_dataset.py index 4d474bd6a..d444d1640 100644 --- a/pyatlan_v9/model/assets/data_mesh_dataset.py +++ b/pyatlan_v9/model/assets/data_mesh_dataset.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -33,6 +40,7 @@ ) from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract +from .data_mesh_related import RelatedDataMeshDataset, RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .data_mesh_related import RelatedDataMeshDataset, RelatedDataProduct # ============================================================================= # FLAT ASSET CLASS @@ -628,33 +628,36 @@ def _data_mesh_dataset_from_nested(nested: DataMeshDatasetNested) -> DataMeshDat _DATA_MESH_DATASET_REL_FIELDS, DataMeshDatasetRelationshipAttributes, ) - return DataMeshDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_mesh_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_mesh_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return DataMeshDataset(**kwargs) def _data_mesh_dataset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/data_product.py b/pyatlan_v9/model/assets/data_product.py index bec34af5c..7a7f98478 100644 --- a/pyatlan_v9/model/assets/data_product.py +++ b/pyatlan_v9/model/assets/data_product.py @@ -20,6 +20,18 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan.errors import ErrorCode +from pyatlan.model.enums import DataProductStatus +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.data_mesh import DataProductsAssetsDSL +from pyatlan_v9.model.search import IndexSearchRequest +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +47,11 @@ from .asset_related import RelatedAsset from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract +from .data_mesh_related import ( + RelatedDataDomain, + RelatedDataMeshDataset, + RelatedDataProduct, +) from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm @@ -49,23 +66,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .starburst_related import RelatedStarburstDataset -from pyatlan.errors import ErrorCode -from pyatlan.model.enums import DataProductStatus -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.data_mesh import DataProductsAssetsDSL -from pyatlan_v9.model.search import IndexSearchRequest -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .data_mesh_related import ( - RelatedDataDomain, - RelatedDataMeshDataset, - RelatedDataProduct, -) # ============================================================================= # FLAT ASSET CLASS @@ -893,33 +893,36 @@ def _data_product_from_nested(nested: DataProductNested) -> DataProduct: _DATA_PRODUCT_REL_FIELDS, DataProductRelationshipAttributes, ) - return DataProduct( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_product_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_product_attrs(attrs)) + kwargs.update(merged_rels) + return DataProduct(**kwargs) def _data_product_to_nested_bytes(data_product: DataProduct, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/data_quality.py b/pyatlan_v9/model/assets/data_quality.py index 4376d3558..ba1767456 100644 --- a/pyatlan_v9/model/assets/data_quality.py +++ b/pyatlan_v9/model/assets/data_quality.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -33,6 +40,11 @@ from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct +from .data_quality_related import ( + RelatedDataQuality, + RelatedDataQualityRule, + RelatedMetric, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -45,18 +57,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .data_quality_related import ( - RelatedDataQuality, - RelatedDataQualityRule, - RelatedMetric, -) # ============================================================================= # FLAT ASSET CLASS @@ -586,33 +586,36 @@ def _data_quality_from_nested(nested: DataQualityNested) -> DataQuality: _DATA_QUALITY_REL_FIELDS, DataQualityRelationshipAttributes, ) - return DataQuality( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_quality_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_quality_attrs(attrs)) + kwargs.update(merged_rels) + return DataQuality(**kwargs) def _data_quality_to_nested_bytes(data_quality: DataQuality, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/data_quality_rule.py b/pyatlan_v9/model/assets/data_quality_rule.py index 116ab88fc..b24f5c5a7 100644 --- a/pyatlan_v9/model/assets/data_quality_rule.py +++ b/pyatlan_v9/model/assets/data_quality_rule.py @@ -23,6 +23,29 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan.errors import ErrorCode +from pyatlan.model.enums import ( + DataQualityDimension, + DataQualityRuleAlertPriority, + DataQualityRuleCustomSQLReturnType, + DataQualityRuleStatus, + DataQualityRuleTemplateType, + DataQualityRuleThresholdCompareOperator, + DataQualityRuleThresholdUnit, + DataQualitySourceSyncStatus, +) +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.structs import ( + DataQualityRuleConfigArguments, + DataQualityRuleThresholdObject, +) +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -39,6 +62,11 @@ from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct +from .data_quality_related import ( + RelatedDataQualityRule, + RelatedDataQualityRuleTemplate, + RelatedMetric, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -52,34 +80,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedColumn -from pyatlan.errors import ErrorCode -from pyatlan.model.enums import ( - DataQualityDimension, - DataQualityRuleAlertPriority, - DataQualityRuleCustomSQLReturnType, - DataQualityRuleStatus, - DataQualityRuleTemplateType, - DataQualityRuleThresholdCompareOperator, - DataQualityRuleThresholdUnit, - DataQualitySourceSyncStatus, -) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.structs import ( - DataQualityRuleConfigArguments, - DataQualityRuleThresholdObject, -) -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .data_quality_related import ( - RelatedDataQualityRule, - RelatedDataQualityRuleTemplate, - RelatedMetric, -) # ============================================================================= # FLAT ASSET CLASS @@ -1616,33 +1616,36 @@ def _data_quality_rule_from_nested(nested: DataQualityRuleNested) -> DataQuality _DATA_QUALITY_RULE_REL_FIELDS, DataQualityRuleRelationshipAttributes, ) - return DataQualityRule( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_quality_rule_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_quality_rule_attrs(attrs)) + kwargs.update(merged_rels) + return DataQualityRule(**kwargs) def _data_quality_rule_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/data_quality_rule_template.py b/pyatlan_v9/model/assets/data_quality_rule_template.py index 5e9c5ac11..744c82700 100644 --- a/pyatlan_v9/model/assets/data_quality_rule_template.py +++ b/pyatlan_v9/model/assets/data_quality_rule_template.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -33,6 +40,11 @@ from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct +from .data_quality_related import ( + RelatedDataQualityRule, + RelatedDataQualityRuleTemplate, + RelatedMetric, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -45,18 +57,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .data_quality_related import ( - RelatedDataQualityRule, - RelatedDataQualityRuleTemplate, - RelatedMetric, -) # ============================================================================= # FLAT ASSET CLASS @@ -639,33 +639,36 @@ def _data_quality_rule_template_from_nested( _DATA_QUALITY_RULE_TEMPLATE_REL_FIELDS, DataQualityRuleTemplateRelationshipAttributes, ) - return DataQualityRuleTemplate( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_quality_rule_template_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_quality_rule_template_attrs(attrs)) + kwargs.update(merged_rels) + return DataQualityRuleTemplate(**kwargs) def _data_quality_rule_template_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/data_set.py b/pyatlan_v9/model/assets/data_set.py index ee7e565f6..6c4088696 100644 --- a/pyatlan_v9/model/assets/data_set.py +++ b/pyatlan_v9/model/assets/data_set.py @@ -19,8 +19,15 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField +from .asset_related import RelatedDataSet from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -42,13 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde - -from .asset_related import RelatedDataSet # ============================================================================= # FLAT ASSET CLASS @@ -2646,33 +2646,36 @@ def _data_set_from_nested(nested: DataSetNested) -> DataSet: _DATA_SET_REL_FIELDS, DataSetRelationshipAttributes, ) - return DataSet( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_set_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_set_attrs(attrs)) + kwargs.update(merged_rels) + return DataSet(**kwargs) def _data_set_to_nested_bytes(data_set: DataSet, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/data_studio.py b/pyatlan_v9/model/assets/data_studio.py index 225301ad0..b12c40146 100644 --- a/pyatlan_v9/model/assets/data_studio.py +++ b/pyatlan_v9/model/assets/data_studio.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .data_studio_related import RelatedDataStudio from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .data_studio_related import RelatedDataStudio # ============================================================================= # FLAT ASSET CLASS @@ -653,33 +653,36 @@ def _data_studio_from_nested(nested: DataStudioNested) -> DataStudio: _DATA_STUDIO_REL_FIELDS, DataStudioRelationshipAttributes, ) - return DataStudio( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_studio_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_studio_attrs(attrs)) + kwargs.update(merged_rels) + return DataStudio(**kwargs) def _data_studio_to_nested_bytes(data_studio: DataStudio, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/data_studio_asset.py b/pyatlan_v9/model/assets/data_studio_asset.py index f3519e826..713aaf1bc 100644 --- a/pyatlan_v9/model/assets/data_studio_asset.py +++ b/pyatlan_v9/model/assets/data_studio_asset.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .data_studio_related import RelatedDataStudioAsset from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -46,15 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .data_studio_related import RelatedDataStudioAsset # ============================================================================= # FLAT ASSET CLASS @@ -742,33 +742,36 @@ def _data_studio_asset_from_nested(nested: DataStudioAssetNested) -> DataStudioA _DATA_STUDIO_ASSET_REL_FIELDS, DataStudioAssetRelationshipAttributes, ) - return DataStudioAsset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_data_studio_asset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_data_studio_asset_attrs(attrs)) + kwargs.update(merged_rels) + return DataStudioAsset(**kwargs) def _data_studio_asset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/database.py b/pyatlan_v9/model/assets/database.py index 692f2aed0..68c77cd06 100644 --- a/pyatlan_v9/model/assets/database.py +++ b/pyatlan_v9/model/assets/database.py @@ -19,6 +19,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -59,14 +67,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .sql_related import RelatedDatabase, RelatedSchema # ============================================================================= @@ -1110,33 +1110,36 @@ def _database_from_nested(nested: DatabaseNested) -> Database: _DATABASE_REL_FIELDS, DatabaseRelationshipAttributes, ) - return Database( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_database_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_database_attrs(attrs)) + kwargs.update(merged_rels) + return Database(**kwargs) def _database_to_nested_bytes(database: Database, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/databricks.py b/pyatlan_v9/model/assets/databricks.py index cf4df2c4c..856d6a2a3 100644 --- a/pyatlan_v9/model/assets/databricks.py +++ b/pyatlan_v9/model/assets/databricks.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import RelatedDatabricks from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -58,14 +66,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import RelatedDatabricks # ============================================================================= # FLAT ASSET CLASS @@ -999,33 +999,36 @@ def _databricks_from_nested(nested: DatabricksNested) -> Databricks: _DATABRICKS_REL_FIELDS, DatabricksRelationshipAttributes, ) - return Databricks( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_attrs(attrs)) + kwargs.update(merged_rels) + return Databricks(**kwargs) def _databricks_to_nested_bytes(databricks: Databricks, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/databricks_ai_model_context.py b/pyatlan_v9/model/assets/databricks_ai_model_context.py index 187cdf84b..39a5f7cd5 100644 --- a/pyatlan_v9/model/assets/databricks_ai_model_context.py +++ b/pyatlan_v9/model/assets/databricks_ai_model_context.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .ai_related import RelatedAIApplication, RelatedAIModelVersion from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -37,6 +44,10 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import ( + RelatedDatabricksAIModelContext, + RelatedDatabricksAIModelVersion, +) from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -61,17 +72,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import ( - RelatedDatabricksAIModelContext, - RelatedDatabricksAIModelVersion, -) # ============================================================================= # FLAT ASSET CLASS @@ -1232,33 +1232,36 @@ def _databricks_ai_model_context_from_nested( _DATABRICKS_AI_MODEL_CONTEXT_REL_FIELDS, DatabricksAIModelContextRelationshipAttributes, ) - return DatabricksAIModelContext( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_ai_model_context_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_ai_model_context_attrs(attrs)) + kwargs.update(merged_rels) + return DatabricksAIModelContext(**kwargs) def _databricks_ai_model_context_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/databricks_ai_model_version.py b/pyatlan_v9/model/assets/databricks_ai_model_version.py index 815c6cb67..3873dc970 100644 --- a/pyatlan_v9/model/assets/databricks_ai_model_version.py +++ b/pyatlan_v9/model/assets/databricks_ai_model_version.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .ai_related import RelatedAIModel from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -37,6 +44,10 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import ( + RelatedDatabricksAIModelContext, + RelatedDatabricksAIModelVersion, +) from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -60,17 +71,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import ( - RelatedDatabricksAIModelContext, - RelatedDatabricksAIModelVersion, -) # ============================================================================= # FLAT ASSET CLASS @@ -1380,33 +1380,36 @@ def _databricks_ai_model_version_from_nested( _DATABRICKS_AI_MODEL_VERSION_REL_FIELDS, DatabricksAIModelVersionRelationshipAttributes, ) - return DatabricksAIModelVersion( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_ai_model_version_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_ai_model_version_attrs(attrs)) + kwargs.update(merged_rels) + return DatabricksAIModelVersion(**kwargs) def _databricks_ai_model_version_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/databricks_dashboard.py b/pyatlan_v9/model/assets/databricks_dashboard.py index b739784c9..c40a09b94 100644 --- a/pyatlan_v9/model/assets/databricks_dashboard.py +++ b/pyatlan_v9/model/assets/databricks_dashboard.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import RelatedDatabricksDashboard from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -59,14 +67,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import RelatedDatabricksDashboard # ============================================================================= # FLAT ASSET CLASS @@ -1089,33 +1089,36 @@ def _databricks_dashboard_from_nested( _DATABRICKS_DASHBOARD_REL_FIELDS, DatabricksDashboardRelationshipAttributes, ) - return DatabricksDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return DatabricksDashboard(**kwargs) def _databricks_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/databricks_external_location.py b/pyatlan_v9/model/assets/databricks_external_location.py index 5b3656930..0a266b585 100644 --- a/pyatlan_v9/model/assets/databricks_external_location.py +++ b/pyatlan_v9/model/assets/databricks_external_location.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,10 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import ( + RelatedDatabricksExternalLocation, + RelatedDatabricksExternalLocationPath, +) from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -58,17 +69,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import ( - RelatedDatabricksExternalLocation, - RelatedDatabricksExternalLocationPath, -) # ============================================================================= # FLAT ASSET CLASS @@ -1050,33 +1050,36 @@ def _databricks_external_location_from_nested( _DATABRICKS_EXTERNAL_LOCATION_REL_FIELDS, DatabricksExternalLocationRelationshipAttributes, ) - return DatabricksExternalLocation( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_external_location_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_external_location_attrs(attrs)) + kwargs.update(merged_rels) + return DatabricksExternalLocation(**kwargs) def _databricks_external_location_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/databricks_external_location_path.py b/pyatlan_v9/model/assets/databricks_external_location_path.py index 97af4d5cc..f4d00e054 100644 --- a/pyatlan_v9/model/assets/databricks_external_location_path.py +++ b/pyatlan_v9/model/assets/databricks_external_location_path.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,10 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import ( + RelatedDatabricksExternalLocation, + RelatedDatabricksExternalLocationPath, +) from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -59,17 +70,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import ( - RelatedDatabricksExternalLocation, - RelatedDatabricksExternalLocationPath, -) # ============================================================================= # FLAT ASSET CLASS @@ -1076,33 +1076,36 @@ def _databricks_external_location_path_from_nested( _DATABRICKS_EXTERNAL_LOCATION_PATH_REL_FIELDS, DatabricksExternalLocationPathRelationshipAttributes, ) - return DatabricksExternalLocationPath( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_external_location_path_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_external_location_path_attrs(attrs)) + kwargs.update(merged_rels) + return DatabricksExternalLocationPath(**kwargs) def _databricks_external_location_path_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/databricks_genie_agent.py b/pyatlan_v9/model/assets/databricks_genie_agent.py index 89674bf1b..e01a05da7 100644 --- a/pyatlan_v9/model/assets/databricks_genie_agent.py +++ b/pyatlan_v9/model/assets/databricks_genie_agent.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import RelatedDatabricksGenieAgent from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -60,14 +68,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import RelatedDatabricksGenieAgent # ============================================================================= # FLAT ASSET CLASS @@ -1183,33 +1183,36 @@ def _databricks_genie_agent_from_nested( _DATABRICKS_GENIE_AGENT_REL_FIELDS, DatabricksGenieAgentRelationshipAttributes, ) - return DatabricksGenieAgent( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_genie_agent_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_genie_agent_attrs(attrs)) + kwargs.update(merged_rels) + return DatabricksGenieAgent(**kwargs) def _databricks_genie_agent_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/databricks_metric_view.py b/pyatlan_v9/model/assets/databricks_metric_view.py index 0f03d7b7b..2e37ca1ca 100644 --- a/pyatlan_v9/model/assets/databricks_metric_view.py +++ b/pyatlan_v9/model/assets/databricks_metric_view.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import RelatedDatabricksMetricView from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -59,14 +67,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedColumn, RelatedQuery, RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import RelatedDatabricksMetricView # ============================================================================= # FLAT ASSET CLASS @@ -1112,33 +1112,36 @@ def _databricks_metric_view_from_nested( _DATABRICKS_METRIC_VIEW_REL_FIELDS, DatabricksMetricViewRelationshipAttributes, ) - return DatabricksMetricView( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_metric_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_metric_view_attrs(attrs)) + kwargs.update(merged_rels) + return DatabricksMetricView(**kwargs) def _databricks_metric_view_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/databricks_notebook.py b/pyatlan_v9/model/assets/databricks_notebook.py index 9295549e0..20a91f15a 100644 --- a/pyatlan_v9/model/assets/databricks_notebook.py +++ b/pyatlan_v9/model/assets/databricks_notebook.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import RelatedDatabricksNotebook from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -58,14 +66,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import RelatedDatabricksNotebook # ============================================================================= # FLAT ASSET CLASS @@ -1031,33 +1031,36 @@ def _databricks_notebook_from_nested( _DATABRICKS_NOTEBOOK_REL_FIELDS, DatabricksNotebookRelationshipAttributes, ) - return DatabricksNotebook( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_notebook_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_notebook_attrs(attrs)) + kwargs.update(merged_rels) + return DatabricksNotebook(**kwargs) def _databricks_notebook_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/databricks_volume.py b/pyatlan_v9/model/assets/databricks_volume.py index 95cb14def..f4b86e65c 100644 --- a/pyatlan_v9/model/assets/databricks_volume.py +++ b/pyatlan_v9/model/assets/databricks_volume.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import RelatedDatabricksVolume, RelatedDatabricksVolumePath from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -60,14 +68,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import RelatedDatabricksVolume, RelatedDatabricksVolumePath # ============================================================================= # FLAT ASSET CLASS @@ -1082,33 +1082,36 @@ def _databricks_volume_from_nested(nested: DatabricksVolumeNested) -> Databricks _DATABRICKS_VOLUME_REL_FIELDS, DatabricksVolumeRelationshipAttributes, ) - return DatabricksVolume( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_volume_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_volume_attrs(attrs)) + kwargs.update(merged_rels) + return DatabricksVolume(**kwargs) def _databricks_volume_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/databricks_volume_path.py b/pyatlan_v9/model/assets/databricks_volume_path.py index 3065b5442..a446f5654 100644 --- a/pyatlan_v9/model/assets/databricks_volume_path.py +++ b/pyatlan_v9/model/assets/databricks_volume_path.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .databricks_related import RelatedDatabricksVolume, RelatedDatabricksVolumePath from .dbt_related import ( RelatedDbtModel, RelatedDbtSeed, @@ -59,14 +67,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .databricks_related import RelatedDatabricksVolume, RelatedDatabricksVolumePath # ============================================================================= # FLAT ASSET CLASS @@ -1079,33 +1079,36 @@ def _databricks_volume_path_from_nested( _DATABRICKS_VOLUME_PATH_REL_FIELDS, DatabricksVolumePathRelationshipAttributes, ) - return DatabricksVolumePath( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_databricks_volume_path_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_databricks_volume_path_attrs(attrs)) + kwargs.update(merged_rels) + return DatabricksVolumePath(**kwargs) def _databricks_volume_path_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dataverse.py b/pyatlan_v9/model/assets/dataverse.py index 18c9c9ae5..23d8207d5 100644 --- a/pyatlan_v9/model/assets/dataverse.py +++ b/pyatlan_v9/model/assets/dataverse.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dataverse_related import RelatedDataverse from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dataverse_related import RelatedDataverse # ============================================================================= # FLAT ASSET CLASS @@ -599,33 +599,36 @@ def _dataverse_from_nested(nested: DataverseNested) -> Dataverse: _DATAVERSE_REL_FIELDS, DataverseRelationshipAttributes, ) - return Dataverse( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dataverse_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dataverse_attrs(attrs)) + kwargs.update(merged_rels) + return Dataverse(**kwargs) def _dataverse_to_nested_bytes(dataverse: Dataverse, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dataverse_attribute.py b/pyatlan_v9/model/assets/dataverse_attribute.py index 2f17b07c0..0ab640213 100644 --- a/pyatlan_v9/model/assets/dataverse_attribute.py +++ b/pyatlan_v9/model/assets/dataverse_attribute.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +43,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dataverse_related import RelatedDataverseAttribute, RelatedDataverseEntity from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,15 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .dataverse_related import RelatedDataverseAttribute, RelatedDataverseEntity # ============================================================================= # FLAT ASSET CLASS @@ -738,33 +738,36 @@ def _dataverse_attribute_from_nested( _DATAVERSE_ATTRIBUTE_REL_FIELDS, DataverseAttributeRelationshipAttributes, ) - return DataverseAttribute( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dataverse_attribute_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dataverse_attribute_attrs(attrs)) + kwargs.update(merged_rels) + return DataverseAttribute(**kwargs) def _dataverse_attribute_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dataverse_entity.py b/pyatlan_v9/model/assets/dataverse_entity.py index 831bb9940..a1bc2a136 100644 --- a/pyatlan_v9/model/assets/dataverse_entity.py +++ b/pyatlan_v9/model/assets/dataverse_entity.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dataverse_related import RelatedDataverseAttribute, RelatedDataverseEntity from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -46,15 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .dataverse_related import RelatedDataverseAttribute, RelatedDataverseEntity # ============================================================================= # FLAT ASSET CLASS @@ -678,33 +678,36 @@ def _dataverse_entity_from_nested(nested: DataverseEntityNested) -> DataverseEnt _DATAVERSE_ENTITY_REL_FIELDS, DataverseEntityRelationshipAttributes, ) - return DataverseEntity( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dataverse_entity_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dataverse_entity_attrs(attrs)) + kwargs.update(merged_rels) + return DataverseEntity(**kwargs) def _dataverse_entity_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dbt.py b/pyatlan_v9/model/assets/dbt.py index 08d39a531..fb32bab0b 100644 --- a/pyatlan_v9/model/assets/dbt.py +++ b/pyatlan_v9/model/assets/dbt.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbt from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbt # ============================================================================= # FLAT ASSET CLASS @@ -737,33 +737,36 @@ def _dbt_from_nested(nested: DbtNested) -> Dbt: _DBT_REL_FIELDS, DbtRelationshipAttributes, ) - return Dbt( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_attrs(attrs)) + kwargs.update(merged_rels) + return Dbt(**kwargs) def _dbt_to_nested_bytes(dbt: Dbt, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dbt_column_process.py b/pyatlan_v9/model/assets/dbt_column_process.py index 914dfc17b..657eda7bc 100644 --- a/pyatlan_v9/model/assets/dbt_column_process.py +++ b/pyatlan_v9/model/assets/dbt_column_process.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .adf_related import RelatedAdfActivity from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -38,6 +45,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbtColumnProcess from .fabric_related import RelatedFabricActivity from .fivetran_related import RelatedFivetranConnector from .flow_related import RelatedFlowControlOperation @@ -56,14 +64,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedFunction, RelatedProcedure -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbtColumnProcess # ============================================================================= # FLAT ASSET CLASS @@ -974,33 +974,36 @@ def _dbt_column_process_from_nested(nested: DbtColumnProcessNested) -> DbtColumn _DBT_COLUMN_PROCESS_REL_FIELDS, DbtColumnProcessRelationshipAttributes, ) - return DbtColumnProcess( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_column_process_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_column_process_attrs(attrs)) + kwargs.update(merged_rels) + return DbtColumnProcess(**kwargs) def _dbt_column_process_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dbt_dimension.py b/pyatlan_v9/model/assets/dbt_dimension.py index f1c5d9daf..cf9aafa2e 100644 --- a/pyatlan_v9/model/assets/dbt_dimension.py +++ b/pyatlan_v9/model/assets/dbt_dimension.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbtDimension from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .semantic_related import RelatedSemanticModel from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbtDimension # ============================================================================= # FLAT ASSET CLASS @@ -843,33 +843,36 @@ def _dbt_dimension_from_nested(nested: DbtDimensionNested) -> DbtDimension: _DBT_DIMENSION_REL_FIELDS, DbtDimensionRelationshipAttributes, ) - return DbtDimension( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_dimension_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_dimension_attrs(attrs)) + kwargs.update(merged_rels) + return DbtDimension(**kwargs) def _dbt_dimension_to_nested_bytes(dbt_dimension: DbtDimension, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dbt_entity.py b/pyatlan_v9/model/assets/dbt_entity.py index 23db55466..76ed174be 100644 --- a/pyatlan_v9/model/assets/dbt_entity.py +++ b/pyatlan_v9/model/assets/dbt_entity.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbtEntity from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .semantic_related import RelatedSemanticModel from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbtEntity # ============================================================================= # FLAT ASSET CLASS @@ -826,33 +826,36 @@ def _dbt_entity_from_nested(nested: DbtEntityNested) -> DbtEntity: _DBT_ENTITY_REL_FIELDS, DbtEntityRelationshipAttributes, ) - return DbtEntity( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_entity_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_entity_attrs(attrs)) + kwargs.update(merged_rels) + return DbtEntity(**kwargs) def _dbt_entity_to_nested_bytes(dbt_entity: DbtEntity, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dbt_measure.py b/pyatlan_v9/model/assets/dbt_measure.py index 97f898ec1..fbb665606 100644 --- a/pyatlan_v9/model/assets/dbt_measure.py +++ b/pyatlan_v9/model/assets/dbt_measure.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbtMeasure from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .semantic_related import RelatedSemanticModel from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbtMeasure # ============================================================================= # FLAT ASSET CLASS @@ -826,33 +826,36 @@ def _dbt_measure_from_nested(nested: DbtMeasureNested) -> DbtMeasure: _DBT_MEASURE_REL_FIELDS, DbtMeasureRelationshipAttributes, ) - return DbtMeasure( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_measure_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_measure_attrs(attrs)) + kwargs.update(merged_rels) + return DbtMeasure(**kwargs) def _dbt_measure_to_nested_bytes(dbt_measure: DbtMeasure, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dbt_metric.py b/pyatlan_v9/model/assets/dbt_metric.py index b1b36efa6..98f051c38 100644 --- a/pyatlan_v9/model/assets/dbt_metric.py +++ b/pyatlan_v9/model/assets/dbt_metric.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbtMetric, RelatedDbtModel from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -49,14 +57,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedColumn -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbtMetric, RelatedDbtModel # ============================================================================= # FLAT ASSET CLASS @@ -882,33 +882,36 @@ def _dbt_metric_from_nested(nested: DbtMetricNested) -> DbtMetric: _DBT_METRIC_REL_FIELDS, DbtMetricRelationshipAttributes, ) - return DbtMetric( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_metric_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_metric_attrs(attrs)) + kwargs.update(merged_rels) + return DbtMetric(**kwargs) def _dbt_metric_to_nested_bytes(dbt_metric: DbtMetric, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dbt_model.py b/pyatlan_v9/model/assets/dbt_model.py index 6e81a819f..3f62484ef 100644 --- a/pyatlan_v9/model/assets/dbt_model.py +++ b/pyatlan_v9/model/assets/dbt_model.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,12 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import ( + RelatedDbtMetric, + RelatedDbtModel, + RelatedDbtModelColumn, + RelatedDbtTest, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -49,19 +62,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedSQL -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import ( - RelatedDbtMetric, - RelatedDbtModel, - RelatedDbtModelColumn, - RelatedDbtTest, -) # ============================================================================= # FLAT ASSET CLASS @@ -928,33 +928,36 @@ def _dbt_model_from_nested(nested: DbtModelNested) -> DbtModel: _DBT_MODEL_REL_FIELDS, DbtModelRelationshipAttributes, ) - return DbtModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_model_attrs(attrs)) + kwargs.update(merged_rels) + return DbtModel(**kwargs) def _dbt_model_to_nested_bytes(dbt_model: DbtModel, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dbt_model_column.py b/pyatlan_v9/model/assets/dbt_model_column.py index 126fc9df8..595f4005e 100644 --- a/pyatlan_v9/model/assets/dbt_model_column.py +++ b/pyatlan_v9/model/assets/dbt_model_column.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,12 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import ( + RelatedDbtModel, + RelatedDbtModelColumn, + RelatedDbtSeed, + RelatedDbtTest, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -48,19 +61,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedColumn -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import ( - RelatedDbtModel, - RelatedDbtModelColumn, - RelatedDbtSeed, - RelatedDbtTest, -) # ============================================================================= # FLAT ASSET CLASS @@ -843,33 +843,36 @@ def _dbt_model_column_from_nested(nested: DbtModelColumnNested) -> DbtModelColum _DBT_MODEL_COLUMN_REL_FIELDS, DbtModelColumnRelationshipAttributes, ) - return DbtModelColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_model_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_model_column_attrs(attrs)) + kwargs.update(merged_rels) + return DbtModelColumn(**kwargs) def _dbt_model_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dbt_process.py b/pyatlan_v9/model/assets/dbt_process.py index fdb7a256c..8dd1f011b 100644 --- a/pyatlan_v9/model/assets/dbt_process.py +++ b/pyatlan_v9/model/assets/dbt_process.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .adf_related import RelatedAdfActivity from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -38,6 +45,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbtProcess from .fabric_related import RelatedFabricActivity from .fivetran_related import RelatedFivetranConnector from .flow_related import RelatedFlowControlOperation @@ -56,14 +64,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedFunction, RelatedProcedure -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbtProcess # ============================================================================= # FLAT ASSET CLASS @@ -963,33 +963,36 @@ def _dbt_process_from_nested(nested: DbtProcessNested) -> DbtProcess: _DBT_PROCESS_REL_FIELDS, DbtProcessRelationshipAttributes, ) - return DbtProcess( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_process_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_process_attrs(attrs)) + kwargs.update(merged_rels) + return DbtProcess(**kwargs) def _dbt_process_to_nested_bytes(dbt_process: DbtProcess, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dbt_seed.py b/pyatlan_v9/model/assets/dbt_seed.py index 453b36ba0..0ad8c92f6 100644 --- a/pyatlan_v9/model/assets/dbt_seed.py +++ b/pyatlan_v9/model/assets/dbt_seed.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbtModelColumn, RelatedDbtSeed from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -48,14 +56,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedSQL -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbtModelColumn, RelatedDbtSeed # ============================================================================= # FLAT ASSET CLASS @@ -789,33 +789,36 @@ def _dbt_seed_from_nested(nested: DbtSeedNested) -> DbtSeed: _DBT_SEED_REL_FIELDS, DbtSeedRelationshipAttributes, ) - return DbtSeed( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_seed_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_seed_attrs(attrs)) + kwargs.update(merged_rels) + return DbtSeed(**kwargs) def _dbt_seed_to_nested_bytes(dbt_seed: DbtSeed, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dbt_semantic_model.py b/pyatlan_v9/model/assets/dbt_semantic_model.py index 1a7c14dc2..592b7e2eb 100644 --- a/pyatlan_v9/model/assets/dbt_semantic_model.py +++ b/pyatlan_v9/model/assets/dbt_semantic_model.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbtSemanticModel from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -51,14 +59,6 @@ ) from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbtSemanticModel # ============================================================================= # FLAT ASSET CLASS @@ -784,33 +784,36 @@ def _dbt_semantic_model_from_nested(nested: DbtSemanticModelNested) -> DbtSemant _DBT_SEMANTIC_MODEL_REL_FIELDS, DbtSemanticModelRelationshipAttributes, ) - return DbtSemanticModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_semantic_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_semantic_model_attrs(attrs)) + kwargs.update(merged_rels) + return DbtSemanticModel(**kwargs) def _dbt_semantic_model_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dbt_source.py b/pyatlan_v9/model/assets/dbt_source.py index 52730e4d0..1fd2d0f7e 100644 --- a/pyatlan_v9/model/assets/dbt_source.py +++ b/pyatlan_v9/model/assets/dbt_source.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbtSource, RelatedDbtTest from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -48,14 +56,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedSQL -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbtSource, RelatedDbtTest # ============================================================================= # FLAT ASSET CLASS @@ -799,33 +799,36 @@ def _dbt_source_from_nested(nested: DbtSourceNested) -> DbtSource: _DBT_SOURCE_REL_FIELDS, DbtSourceRelationshipAttributes, ) - return DbtSource( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_source_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_source_attrs(attrs)) + kwargs.update(merged_rels) + return DbtSource(**kwargs) def _dbt_source_to_nested_bytes(dbt_source: DbtSource, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dbt_tag.py b/pyatlan_v9/model/assets/dbt_tag.py index a136ce50d..e30a4380a 100644 --- a/pyatlan_v9/model/assets/dbt_tag.py +++ b/pyatlan_v9/model/assets/dbt_tag.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import RelatedDbtTag from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import RelatedDbtTag # ============================================================================= # FLAT ASSET CLASS @@ -794,33 +794,36 @@ def _dbt_tag_from_nested(nested: DbtTagNested) -> DbtTag: _DBT_TAG_REL_FIELDS, DbtTagRelationshipAttributes, ) - return DbtTag( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_tag_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_tag_attrs(attrs)) + kwargs.update(merged_rels) + return DbtTag(**kwargs) def _dbt_tag_to_nested_bytes(dbt_tag: DbtTag, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dbt_test.py b/pyatlan_v9/model/assets/dbt_test.py index 2b426f07d..3d20872b0 100644 --- a/pyatlan_v9/model/assets/dbt_test.py +++ b/pyatlan_v9/model/assets/dbt_test.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,12 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dbt_related import ( + RelatedDbtModel, + RelatedDbtModelColumn, + RelatedDbtSource, + RelatedDbtTest, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -48,19 +61,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedSQL -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dbt_related import ( - RelatedDbtModel, - RelatedDbtModelColumn, - RelatedDbtSource, - RelatedDbtTest, -) # ============================================================================= # FLAT ASSET CLASS @@ -860,33 +860,36 @@ def _dbt_test_from_nested(nested: DbtTestNested) -> DbtTest: _DBT_TEST_REL_FIELDS, DbtTestRelationshipAttributes, ) - return DbtTest( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dbt_test_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dbt_test_attrs(attrs)) + kwargs.update(merged_rels) + return DbtTest(**kwargs) def _dbt_test_to_nested_bytes(dbt_test: DbtTest, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/document_db.py b/pyatlan_v9/model/assets/document_db.py index 0f0710283..f92cc8969 100644 --- a/pyatlan_v9/model/assets/document_db.py +++ b/pyatlan_v9/model/assets/document_db.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .document_db_related import RelatedDocumentDB from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .document_db_related import RelatedDocumentDB # ============================================================================= # FLAT ASSET CLASS @@ -586,33 +586,36 @@ def _document_db_from_nested(nested: DocumentDBNested) -> DocumentDB: _DOCUMENT_DB_REL_FIELDS, DocumentDBRelationshipAttributes, ) - return DocumentDB( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_document_db_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_document_db_attrs(attrs)) + kwargs.update(merged_rels) + return DocumentDB(**kwargs) def _document_db_to_nested_bytes(document_db: DocumentDB, serde: Serde) -> bytes: @@ -629,10 +632,7 @@ def _document_db_from_nested_bytes(data: bytes, serde: Serde) -> DocumentDB: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 DocumentDB.NO_SQL_SCHEMA_DEFINITION = KeywordField( "noSQLSchemaDefinition", "noSQLSchemaDefinition" diff --git a/pyatlan_v9/model/assets/document_db_collection.py b/pyatlan_v9/model/assets/document_db_collection.py index ece575a38..083c25d95 100644 --- a/pyatlan_v9/model/assets/document_db_collection.py +++ b/pyatlan_v9/model/assets/document_db_collection.py @@ -20,6 +20,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,6 +50,7 @@ RelatedDbtSource, RelatedDbtTest, ) +from .document_db_related import RelatedDocumentDBCollection, RelatedDocumentDBDatabase from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -66,15 +75,6 @@ RelatedTable, RelatedTablePartition, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .document_db_related import RelatedDocumentDBCollection, RelatedDocumentDBDatabase # ============================================================================= # FLAT ASSET CLASS @@ -1590,33 +1590,36 @@ def _document_db_collection_from_nested( _DOCUMENT_DB_COLLECTION_REL_FIELDS, DocumentDBCollectionRelationshipAttributes, ) - return DocumentDBCollection( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_document_db_collection_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_document_db_collection_attrs(attrs)) + kwargs.update(merged_rels) + return DocumentDBCollection(**kwargs) def _document_db_collection_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/document_db_database.py b/pyatlan_v9/model/assets/document_db_database.py index 878409865..706732562 100644 --- a/pyatlan_v9/model/assets/document_db_database.py +++ b/pyatlan_v9/model/assets/document_db_database.py @@ -19,6 +19,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,6 +49,7 @@ RelatedDbtSource, RelatedDbtTest, ) +from .document_db_related import RelatedDocumentDBCollection, RelatedDocumentDBDatabase from .fabric_related import RelatedFabricWorkspace from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm @@ -60,15 +69,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .document_db_related import RelatedDocumentDBCollection, RelatedDocumentDBDatabase # ============================================================================= # FLAT ASSET CLASS @@ -1143,33 +1143,36 @@ def _document_db_database_from_nested( _DOCUMENT_DB_DATABASE_REL_FIELDS, DocumentDBDatabaseRelationshipAttributes, ) - return DocumentDBDatabase( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_document_db_database_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_document_db_database_attrs(attrs)) + kwargs.update(merged_rels) + return DocumentDBDatabase(**kwargs) def _document_db_database_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/domo.py b/pyatlan_v9/model/assets/domo.py index e97a95689..44c4a7e32 100644 --- a/pyatlan_v9/model/assets/domo.py +++ b/pyatlan_v9/model/assets/domo.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .domo_related import RelatedDomo from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .domo_related import RelatedDomo # ============================================================================= # FLAT ASSET CLASS @@ -584,33 +584,36 @@ def _domo_from_nested(nested: DomoNested) -> Domo: _DOMO_REL_FIELDS, DomoRelationshipAttributes, ) - return Domo( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_domo_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_domo_attrs(attrs)) + kwargs.update(merged_rels) + return Domo(**kwargs) def _domo_to_nested_bytes(domo: Domo, serde: Serde) -> bytes: @@ -627,10 +630,7 @@ def _domo_from_nested_bytes(data: bytes, serde: Serde) -> Domo: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Domo.DOMO_ID = KeywordField("domoId", "domoId") Domo.DOMO_OWNER_ID = KeywordField("domoOwnerId", "domoOwnerId") diff --git a/pyatlan_v9/model/assets/domo_card.py b/pyatlan_v9/model/assets/domo_card.py index 98fef0e60..757e90596 100644 --- a/pyatlan_v9/model/assets/domo_card.py +++ b/pyatlan_v9/model/assets/domo_card.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .domo_related import RelatedDomoCard, RelatedDomoDashboard, RelatedDomoDataset from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .domo_related import RelatedDomoCard, RelatedDomoDashboard, RelatedDomoDataset # ============================================================================= # FLAT ASSET CLASS @@ -646,33 +646,36 @@ def _domo_card_from_nested(nested: DomoCardNested) -> DomoCard: _DOMO_CARD_REL_FIELDS, DomoCardRelationshipAttributes, ) - return DomoCard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_domo_card_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_domo_card_attrs(attrs)) + kwargs.update(merged_rels) + return DomoCard(**kwargs) def _domo_card_to_nested_bytes(domo_card: DomoCard, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/domo_dashboard.py b/pyatlan_v9/model/assets/domo_dashboard.py index 38c647cd8..4c59973a2 100644 --- a/pyatlan_v9/model/assets/domo_dashboard.py +++ b/pyatlan_v9/model/assets/domo_dashboard.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .domo_related import RelatedDomoCard, RelatedDomoDashboard from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .domo_related import RelatedDomoCard, RelatedDomoDashboard # ============================================================================= # FLAT ASSET CLASS @@ -640,33 +640,36 @@ def _domo_dashboard_from_nested(nested: DomoDashboardNested) -> DomoDashboard: _DOMO_DASHBOARD_REL_FIELDS, DomoDashboardRelationshipAttributes, ) - return DomoDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_domo_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_domo_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return DomoDashboard(**kwargs) def _domo_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/domo_dataset.py b/pyatlan_v9/model/assets/domo_dataset.py index 569b85a01..37e716e8e 100644 --- a/pyatlan_v9/model/assets/domo_dataset.py +++ b/pyatlan_v9/model/assets/domo_dataset.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .domo_related import RelatedDomoCard, RelatedDomoDataset, RelatedDomoDatasetColumn from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .domo_related import RelatedDomoCard, RelatedDomoDataset, RelatedDomoDatasetColumn # ============================================================================= # FLAT ASSET CLASS @@ -653,33 +653,36 @@ def _domo_dataset_from_nested(nested: DomoDatasetNested) -> DomoDataset: _DOMO_DATASET_REL_FIELDS, DomoDatasetRelationshipAttributes, ) - return DomoDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_domo_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_domo_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return DomoDataset(**kwargs) def _domo_dataset_to_nested_bytes(domo_dataset: DomoDataset, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/domo_dataset_column.py b/pyatlan_v9/model/assets/domo_dataset_column.py index 244029714..39e6b6ffa 100644 --- a/pyatlan_v9/model/assets/domo_dataset_column.py +++ b/pyatlan_v9/model/assets/domo_dataset_column.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .domo_related import RelatedDomoDataset, RelatedDomoDatasetColumn from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .domo_related import RelatedDomoDataset, RelatedDomoDatasetColumn # ============================================================================= # FLAT ASSET CLASS @@ -665,33 +665,36 @@ def _domo_dataset_column_from_nested( _DOMO_DATASET_COLUMN_REL_FIELDS, DomoDatasetColumnRelationshipAttributes, ) - return DomoDatasetColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_domo_dataset_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_domo_dataset_column_attrs(attrs)) + kwargs.update(merged_rels) + return DomoDatasetColumn(**kwargs) def _domo_dataset_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dremio.py b/pyatlan_v9/model/assets/dremio.py index 10f7c3f80..872fc8a1f 100644 --- a/pyatlan_v9/model/assets/dremio.py +++ b/pyatlan_v9/model/assets/dremio.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,6 +48,7 @@ RelatedDbtSource, RelatedDbtTest, ) +from .dremio_related import RelatedDremio from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -58,14 +66,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dremio_related import RelatedDremio # ============================================================================= # FLAT ASSET CLASS @@ -1071,33 +1071,36 @@ def _dremio_from_nested(nested: DremioNested) -> Dremio: _DREMIO_REL_FIELDS, DremioRelationshipAttributes, ) - return Dremio( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dremio_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dremio_attrs(attrs)) + kwargs.update(merged_rels) + return Dremio(**kwargs) def _dremio_to_nested_bytes(dremio: Dremio, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dremio_column.py b/pyatlan_v9/model/assets/dremio_column.py index 7cae3422f..9b1ac2f34 100644 --- a/pyatlan_v9/model/assets/dremio_column.py +++ b/pyatlan_v9/model/assets/dremio_column.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,6 +51,7 @@ RelatedDbtSource, RelatedDbtTest, ) +from .dremio_related import RelatedDremioColumn from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -75,14 +83,6 @@ RelatedTablePartition, RelatedView, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dremio_related import RelatedDremioColumn # ============================================================================= # FLAT ASSET CLASS @@ -1969,33 +1969,36 @@ def _dremio_column_from_nested(nested: DremioColumnNested) -> DremioColumn: _DREMIO_COLUMN_REL_FIELDS, DremioColumnRelationshipAttributes, ) - return DremioColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dremio_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dremio_column_attrs(attrs)) + kwargs.update(merged_rels) + return DremioColumn(**kwargs) def _dremio_column_to_nested_bytes(dremio_column: DremioColumn, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dremio_folder.py b/pyatlan_v9/model/assets/dremio_folder.py index d3e725260..4b4b4e9cb 100644 --- a/pyatlan_v9/model/assets/dremio_folder.py +++ b/pyatlan_v9/model/assets/dremio_folder.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,6 +49,13 @@ RelatedDbtSource, RelatedDbtTest, ) +from .dremio_related import ( + RelatedDremioFolder, + RelatedDremioPhysicalDataset, + RelatedDremioSource, + RelatedDremioSpace, + RelatedDremioVirtualDataset, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -59,20 +73,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dremio_related import ( - RelatedDremioFolder, - RelatedDremioPhysicalDataset, - RelatedDremioSource, - RelatedDremioSpace, - RelatedDremioVirtualDataset, -) # ============================================================================= # FLAT ASSET CLASS @@ -1167,33 +1167,36 @@ def _dremio_folder_from_nested(nested: DremioFolderNested) -> DremioFolder: _DREMIO_FOLDER_REL_FIELDS, DremioFolderRelationshipAttributes, ) - return DremioFolder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dremio_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dremio_folder_attrs(attrs)) + kwargs.update(merged_rels) + return DremioFolder(**kwargs) def _dremio_folder_to_nested_bytes(dremio_folder: DremioFolder, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dremio_physical_dataset.py b/pyatlan_v9/model/assets/dremio_physical_dataset.py index 724cf98a3..0d2f905c8 100644 --- a/pyatlan_v9/model/assets/dremio_physical_dataset.py +++ b/pyatlan_v9/model/assets/dremio_physical_dataset.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,6 +49,11 @@ RelatedDbtSource, RelatedDbtTest, ) +from .dremio_related import ( + RelatedDremioFolder, + RelatedDremioPhysicalDataset, + RelatedDremioSource, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -66,18 +78,6 @@ RelatedTable, RelatedTablePartition, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dremio_related import ( - RelatedDremioFolder, - RelatedDremioPhysicalDataset, - RelatedDremioSource, -) # ============================================================================= # FLAT ASSET CLASS @@ -1424,33 +1424,36 @@ def _dremio_physical_dataset_from_nested( _DREMIO_PHYSICAL_DATASET_REL_FIELDS, DremioPhysicalDatasetRelationshipAttributes, ) - return DremioPhysicalDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dremio_physical_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dremio_physical_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return DremioPhysicalDataset(**kwargs) def _dremio_physical_dataset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dremio_source.py b/pyatlan_v9/model/assets/dremio_source.py index 48732711c..e9a110bb9 100644 --- a/pyatlan_v9/model/assets/dremio_source.py +++ b/pyatlan_v9/model/assets/dremio_source.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,6 +48,11 @@ RelatedDbtSource, RelatedDbtTest, ) +from .dremio_related import ( + RelatedDremioFolder, + RelatedDremioPhysicalDataset, + RelatedDremioSource, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -58,18 +70,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dremio_related import ( - RelatedDremioFolder, - RelatedDremioPhysicalDataset, - RelatedDremioSource, -) # ============================================================================= # FLAT ASSET CLASS @@ -1161,33 +1161,36 @@ def _dremio_source_from_nested(nested: DremioSourceNested) -> DremioSource: _DREMIO_SOURCE_REL_FIELDS, DremioSourceRelationshipAttributes, ) - return DremioSource( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dremio_source_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dremio_source_attrs(attrs)) + kwargs.update(merged_rels) + return DremioSource(**kwargs) def _dremio_source_to_nested_bytes(dremio_source: DremioSource, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dremio_space.py b/pyatlan_v9/model/assets/dremio_space.py index a8f5c278c..4ec28830d 100644 --- a/pyatlan_v9/model/assets/dremio_space.py +++ b/pyatlan_v9/model/assets/dremio_space.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,6 +48,11 @@ RelatedDbtSource, RelatedDbtTest, ) +from .dremio_related import ( + RelatedDremioFolder, + RelatedDremioSpace, + RelatedDremioVirtualDataset, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -58,18 +70,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dremio_related import ( - RelatedDremioFolder, - RelatedDremioSpace, - RelatedDremioVirtualDataset, -) # ============================================================================= # FLAT ASSET CLASS @@ -1099,33 +1099,36 @@ def _dremio_space_from_nested(nested: DremioSpaceNested) -> DremioSpace: _DREMIO_SPACE_REL_FIELDS, DremioSpaceRelationshipAttributes, ) - return DremioSpace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dremio_space_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dremio_space_attrs(attrs)) + kwargs.update(merged_rels) + return DremioSpace(**kwargs) def _dremio_space_to_nested_bytes(dremio_space: DremioSpace, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dremio_virtual_dataset.py b/pyatlan_v9/model/assets/dremio_virtual_dataset.py index f45a6f9d8..f85a2140e 100644 --- a/pyatlan_v9/model/assets/dremio_virtual_dataset.py +++ b/pyatlan_v9/model/assets/dremio_virtual_dataset.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,6 +49,11 @@ RelatedDbtSource, RelatedDbtTest, ) +from .dremio_related import ( + RelatedDremioFolder, + RelatedDremioSpace, + RelatedDremioVirtualDataset, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -60,18 +72,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedColumn, RelatedQuery, RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dremio_related import ( - RelatedDremioFolder, - RelatedDremioSpace, - RelatedDremioVirtualDataset, -) # ============================================================================= # FLAT ASSET CLASS @@ -1223,33 +1223,36 @@ def _dremio_virtual_dataset_from_nested( _DREMIO_VIRTUAL_DATASET_REL_FIELDS, DremioVirtualDatasetRelationshipAttributes, ) - return DremioVirtualDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dremio_virtual_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dremio_virtual_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return DremioVirtualDataset(**kwargs) def _dremio_virtual_dataset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dynamo_db.py b/pyatlan_v9/model/assets/dynamo_db.py index 13b8a1c58..a456674d9 100644 --- a/pyatlan_v9/model/assets/dynamo_db.py +++ b/pyatlan_v9/model/assets/dynamo_db.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .dynamo_db_related import RelatedDynamoDB from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dynamo_db_related import RelatedDynamoDB # ============================================================================= # FLAT ASSET CLASS @@ -651,33 +651,36 @@ def _dynamo_db_from_nested(nested: DynamoDBNested) -> DynamoDB: _DYNAMO_DB_REL_FIELDS, DynamoDBRelationshipAttributes, ) - return DynamoDB( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dynamo_db_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dynamo_db_attrs(attrs)) + kwargs.update(merged_rels) + return DynamoDB(**kwargs) def _dynamo_db_to_nested_bytes(dynamo_db: DynamoDB, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/dynamo_db_attribute.py b/pyatlan_v9/model/assets/dynamo_db_attribute.py index 35b0e1dc0..11b8a4d7f 100644 --- a/pyatlan_v9/model/assets/dynamo_db_attribute.py +++ b/pyatlan_v9/model/assets/dynamo_db_attribute.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,6 +52,7 @@ RelatedDbtSource, RelatedDbtTest, ) +from .dynamo_db_related import RelatedDynamoDBAttribute, RelatedDynamoDBTable from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -76,14 +84,6 @@ RelatedTablePartition, RelatedView, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dynamo_db_related import RelatedDynamoDBAttribute, RelatedDynamoDBTable # ============================================================================= # FLAT ASSET CLASS @@ -2011,33 +2011,36 @@ def _dynamo_db_attribute_from_nested( _DYNAMO_DB_ATTRIBUTE_REL_FIELDS, DynamoDBAttributeRelationshipAttributes, ) - return DynamoDBAttribute( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dynamo_db_attribute_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dynamo_db_attribute_attrs(attrs)) + kwargs.update(merged_rels) + return DynamoDBAttribute(**kwargs) def _dynamo_db_attribute_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dynamo_db_secondary_index.py b/pyatlan_v9/model/assets/dynamo_db_secondary_index.py index 3c7c51823..b936b63c1 100644 --- a/pyatlan_v9/model/assets/dynamo_db_secondary_index.py +++ b/pyatlan_v9/model/assets/dynamo_db_secondary_index.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,6 +48,7 @@ RelatedDbtSource, RelatedDbtTest, ) +from .dynamo_db_related import RelatedDynamoDBSecondaryIndex from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -65,14 +73,6 @@ RelatedTable, RelatedTablePartition, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dynamo_db_related import RelatedDynamoDBSecondaryIndex # ============================================================================= # FLAT ASSET CLASS @@ -1410,33 +1410,36 @@ def _dynamo_db_secondary_index_from_nested( _DYNAMO_DB_SECONDARY_INDEX_REL_FIELDS, DynamoDBSecondaryIndexRelationshipAttributes, ) - return DynamoDBSecondaryIndex( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dynamo_db_secondary_index_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dynamo_db_secondary_index_attrs(attrs)) + kwargs.update(merged_rels) + return DynamoDBSecondaryIndex(**kwargs) def _dynamo_db_secondary_index_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/dynamo_db_table.py b/pyatlan_v9/model/assets/dynamo_db_table.py index 2f4021154..2f7de1ba9 100644 --- a/pyatlan_v9/model/assets/dynamo_db_table.py +++ b/pyatlan_v9/model/assets/dynamo_db_table.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,6 +48,12 @@ RelatedDbtSource, RelatedDbtTest, ) +from .dynamo_db_related import ( + RelatedDynamoDBAttribute, + RelatedDynamoDBGlobalSecondaryIndex, + RelatedDynamoDBLocalSecondaryIndex, + RelatedDynamoDBTable, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -65,19 +78,6 @@ RelatedTable, RelatedTablePartition, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .dynamo_db_related import ( - RelatedDynamoDBAttribute, - RelatedDynamoDBGlobalSecondaryIndex, - RelatedDynamoDBLocalSecondaryIndex, - RelatedDynamoDBTable, -) # ============================================================================= # FLAT ASSET CLASS @@ -1450,33 +1450,36 @@ def _dynamo_db_table_from_nested(nested: DynamoDBTableNested) -> DynamoDBTable: _DYNAMO_DB_TABLE_REL_FIELDS, DynamoDBTableRelationshipAttributes, ) - return DynamoDBTable( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_dynamo_db_table_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_dynamo_db_table_attrs(attrs)) + kwargs.update(merged_rels) + return DynamoDBTable(**kwargs) def _dynamo_db_table_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/entity.py b/pyatlan_v9/model/assets/entity.py index c37568320..37887fc44 100644 --- a/pyatlan_v9/model/assets/entity.py +++ b/pyatlan_v9/model/assets/entity.py @@ -18,8 +18,6 @@ import msgspec from msgspec import UNSET, UnsetType -from .related_entity import SaveSemantic - class AtlasClassification( msgspec.Struct, kw_only=True, omit_defaults=True, rename="camel" @@ -31,8 +29,8 @@ class AtlasClassification( propagation settings and validity periods. """ - type_name: Union[Any, UnsetType] = UNSET - """The name of the classification type (str or AtlanTagName after translation).""" + type_name: Union[str, UnsetType] = UNSET + """The name of the classification type.""" entity_guid: Union[str, UnsetType] = UNSET """The GUID of the entity this classification is assigned to.""" @@ -52,18 +50,6 @@ class AtlasClassification( attributes: Union[Dict[str, Any], UnsetType] = UNSET """Custom attributes for this classification.""" - source_tag_attachments: Union[List[Any], None, UnsetType] = UNSET - """Source tag attachments extracted by the AtlanTagName translator.""" - - tag_id: Union[str, None, UnsetType] = UNSET - """Original tag ID before translation to a human-readable name.""" - - restrict_propagation_through_lineage: Union[bool, None, UnsetType] = UNSET - """Whether propagation through lineage is restricted.""" - - restrict_propagation_through_hierarchy: Union[bool, None, UnsetType] = UNSET - """Whether propagation through hierarchy is restricted.""" - class TermAssignment(msgspec.Struct, kw_only=True, omit_defaults=True, rename="camel"): """ @@ -198,18 +184,3 @@ class Entity(msgspec.Struct, kw_only=True, omit_defaults=True, rename="camel"): home_id: Union[str, UnsetType] = UNSET """Home identifier for distributed Atlas systems.""" - - # Lineage-specific fields (only populated in lineage API responses) - depth: Union[int, None, UnsetType] = UNSET - """Depth of this asset within lineage. Only available in assets retrieved via lineage.""" - - immediate_upstream: Union[List[Any], None, UnsetType] = UNSET - """Assets immediately upstream of this asset within lineage.""" - - immediate_downstream: Union[List[Any], None, UnsetType] = UNSET - """Assets immediately downstream of this asset within lineage.""" - - # Internal SDK fields (not sent to API) - semantic: Union[SaveSemantic, None, UnsetType] = UNSET - """Save semantic for relationship operations (REPLACE, APPEND, REMOVE). - Not serialized to JSON - used internally by ref_by_guid/ref_by_qualified_name.""" diff --git a/pyatlan_v9/model/assets/event_store.py b/pyatlan_v9/model/assets/event_store.py index b7a5c3c7e..c82eaa300 100644 --- a/pyatlan_v9/model/assets/event_store.py +++ b/pyatlan_v9/model/assets/event_store.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .catalog_related import RelatedEventStore from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .catalog_related import RelatedEventStore # ============================================================================= # FLAT ASSET CLASS @@ -572,33 +572,36 @@ def _event_store_from_nested(nested: EventStoreNested) -> EventStore: _EVENT_STORE_REL_FIELDS, EventStoreRelationshipAttributes, ) - return EventStore( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_event_store_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_event_store_attrs(attrs)) + kwargs.update(merged_rels) + return EventStore(**kwargs) def _event_store_to_nested_bytes(event_store: EventStore, serde: Serde) -> bytes: @@ -615,10 +618,7 @@ def _event_store_from_nested_bytes(data: bytes, serde: Serde) -> EventStore: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 EventStore.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/fabric.py b/pyatlan_v9/model/assets/fabric.py index 9065e6903..71311b0d3 100644 --- a/pyatlan_v9/model/assets/fabric.py +++ b/pyatlan_v9/model/assets/fabric.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import RelatedFabric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import RelatedFabric # ============================================================================= # FLAT ASSET CLASS @@ -597,33 +597,36 @@ def _fabric_from_nested(nested: FabricNested) -> Fabric: _FABRIC_REL_FIELDS, FabricRelationshipAttributes, ) - return Fabric( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_attrs(attrs)) + kwargs.update(merged_rels) + return Fabric(**kwargs) def _fabric_to_nested_bytes(fabric: Fabric, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/fabric_activity.py b/pyatlan_v9/model/assets/fabric_activity.py index 565aa949b..49d311b1c 100644 --- a/pyatlan_v9/model/assets/fabric_activity.py +++ b/pyatlan_v9/model/assets/fabric_activity.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import RelatedFabricActivity, RelatedFabricDataPipeline from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import RelatedFabricActivity, RelatedFabricDataPipeline # ============================================================================= # FLAT ASSET CLASS @@ -662,33 +662,36 @@ def _fabric_activity_from_nested(nested: FabricActivityNested) -> FabricActivity _FABRIC_ACTIVITY_REL_FIELDS, FabricActivityRelationshipAttributes, ) - return FabricActivity( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_activity_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_activity_attrs(attrs)) + kwargs.update(merged_rels) + return FabricActivity(**kwargs) def _fabric_activity_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/fabric_dashboard.py b/pyatlan_v9/model/assets/fabric_dashboard.py index 1bbfce736..972b98c9c 100644 --- a/pyatlan_v9/model/assets/fabric_dashboard.py +++ b/pyatlan_v9/model/assets/fabric_dashboard.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import RelatedFabricDashboard, RelatedFabricWorkspace from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import RelatedFabricDashboard, RelatedFabricWorkspace # ============================================================================= # FLAT ASSET CLASS @@ -632,33 +632,36 @@ def _fabric_dashboard_from_nested(nested: FabricDashboardNested) -> FabricDashbo _FABRIC_DASHBOARD_REL_FIELDS, FabricDashboardRelationshipAttributes, ) - return FabricDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return FabricDashboard(**kwargs) def _fabric_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/fabric_data_pipeline.py b/pyatlan_v9/model/assets/fabric_data_pipeline.py index fb2ba7c55..870a1d17c 100644 --- a/pyatlan_v9/model/assets/fabric_data_pipeline.py +++ b/pyatlan_v9/model/assets/fabric_data_pipeline.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,11 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import ( + RelatedFabricActivity, + RelatedFabricDataPipeline, + RelatedFabricWorkspace, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import ( - RelatedFabricActivity, - RelatedFabricDataPipeline, - RelatedFabricWorkspace, -) # ============================================================================= # FLAT ASSET CLASS @@ -646,33 +646,36 @@ def _fabric_data_pipeline_from_nested( _FABRIC_DATA_PIPELINE_REL_FIELDS, FabricDataPipelineRelationshipAttributes, ) - return FabricDataPipeline( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_data_pipeline_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_data_pipeline_attrs(attrs)) + kwargs.update(merged_rels) + return FabricDataPipeline(**kwargs) def _fabric_data_pipeline_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/fabric_dataflow.py b/pyatlan_v9/model/assets/fabric_dataflow.py index 0225e6650..bdb5defae 100644 --- a/pyatlan_v9/model/assets/fabric_dataflow.py +++ b/pyatlan_v9/model/assets/fabric_dataflow.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,11 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import ( + RelatedFabricDataflow, + RelatedFabricDataflowEntityColumn, + RelatedFabricWorkspace, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import ( - RelatedFabricDataflow, - RelatedFabricDataflowEntityColumn, - RelatedFabricWorkspace, -) # ============================================================================= # FLAT ASSET CLASS @@ -644,33 +644,36 @@ def _fabric_dataflow_from_nested(nested: FabricDataflowNested) -> FabricDataflow _FABRIC_DATAFLOW_REL_FIELDS, FabricDataflowRelationshipAttributes, ) - return FabricDataflow( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_dataflow_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_dataflow_attrs(attrs)) + kwargs.update(merged_rels) + return FabricDataflow(**kwargs) def _fabric_dataflow_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/fabric_dataflow_entity_column.py b/pyatlan_v9/model/assets/fabric_dataflow_entity_column.py index 8e70e32f3..a182f79c4 100644 --- a/pyatlan_v9/model/assets/fabric_dataflow_entity_column.py +++ b/pyatlan_v9/model/assets/fabric_dataflow_entity_column.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import RelatedFabricDataflow, RelatedFabricDataflowEntityColumn from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import RelatedFabricDataflow, RelatedFabricDataflowEntityColumn # ============================================================================= # FLAT ASSET CLASS @@ -662,33 +662,36 @@ def _fabric_dataflow_entity_column_from_nested( _FABRIC_DATAFLOW_ENTITY_COLUMN_REL_FIELDS, FabricDataflowEntityColumnRelationshipAttributes, ) - return FabricDataflowEntityColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_dataflow_entity_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_dataflow_entity_column_attrs(attrs)) + kwargs.update(merged_rels) + return FabricDataflowEntityColumn(**kwargs) def _fabric_dataflow_entity_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/fabric_page.py b/pyatlan_v9/model/assets/fabric_page.py index 3c6493546..cba00483e 100644 --- a/pyatlan_v9/model/assets/fabric_page.py +++ b/pyatlan_v9/model/assets/fabric_page.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import RelatedFabricPage, RelatedFabricReport, RelatedFabricVisual from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import RelatedFabricPage, RelatedFabricReport, RelatedFabricVisual # ============================================================================= # FLAT ASSET CLASS @@ -641,33 +641,36 @@ def _fabric_page_from_nested(nested: FabricPageNested) -> FabricPage: _FABRIC_PAGE_REL_FIELDS, FabricPageRelationshipAttributes, ) - return FabricPage( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_page_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_page_attrs(attrs)) + kwargs.update(merged_rels) + return FabricPage(**kwargs) def _fabric_page_to_nested_bytes(fabric_page: FabricPage, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/fabric_report.py b/pyatlan_v9/model/assets/fabric_report.py index 69701a1ad..e64f48fdc 100644 --- a/pyatlan_v9/model/assets/fabric_report.py +++ b/pyatlan_v9/model/assets/fabric_report.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,11 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import ( + RelatedFabricPage, + RelatedFabricReport, + RelatedFabricWorkspace, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import ( - RelatedFabricPage, - RelatedFabricReport, - RelatedFabricWorkspace, -) # ============================================================================= # FLAT ASSET CLASS @@ -638,33 +638,36 @@ def _fabric_report_from_nested(nested: FabricReportNested) -> FabricReport: _FABRIC_REPORT_REL_FIELDS, FabricReportRelationshipAttributes, ) - return FabricReport( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_report_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_report_attrs(attrs)) + kwargs.update(merged_rels) + return FabricReport(**kwargs) def _fabric_report_to_nested_bytes(fabric_report: FabricReport, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/fabric_semantic_model.py b/pyatlan_v9/model/assets/fabric_semantic_model.py index 3770179e2..0e04d0b34 100644 --- a/pyatlan_v9/model/assets/fabric_semantic_model.py +++ b/pyatlan_v9/model/assets/fabric_semantic_model.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,11 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import ( + RelatedFabricSemanticModel, + RelatedFabricSemanticModelTable, + RelatedFabricWorkspace, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import ( - RelatedFabricSemanticModel, - RelatedFabricSemanticModelTable, - RelatedFabricWorkspace, -) # ============================================================================= # FLAT ASSET CLASS @@ -650,33 +650,36 @@ def _fabric_semantic_model_from_nested( _FABRIC_SEMANTIC_MODEL_REL_FIELDS, FabricSemanticModelRelationshipAttributes, ) - return FabricSemanticModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_semantic_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_semantic_model_attrs(attrs)) + kwargs.update(merged_rels) + return FabricSemanticModel(**kwargs) def _fabric_semantic_model_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/fabric_semantic_model_measure.py b/pyatlan_v9/model/assets/fabric_semantic_model_measure.py index 077fce46e..8fa2ab997 100644 --- a/pyatlan_v9/model/assets/fabric_semantic_model_measure.py +++ b/pyatlan_v9/model/assets/fabric_semantic_model_measure.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,11 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import ( + RelatedFabricSemanticModelMeasure, + RelatedFabricSemanticModelTable, + RelatedFabricSemanticModelTableColumn, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import ( - RelatedFabricSemanticModelMeasure, - RelatedFabricSemanticModelTable, - RelatedFabricSemanticModelTableColumn, -) # ============================================================================= # FLAT ASSET CLASS @@ -752,33 +752,36 @@ def _fabric_semantic_model_measure_from_nested( _FABRIC_SEMANTIC_MODEL_MEASURE_REL_FIELDS, FabricSemanticModelMeasureRelationshipAttributes, ) - return FabricSemanticModelMeasure( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_semantic_model_measure_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_semantic_model_measure_attrs(attrs)) + kwargs.update(merged_rels) + return FabricSemanticModelMeasure(**kwargs) def _fabric_semantic_model_measure_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/fabric_semantic_model_table.py b/pyatlan_v9/model/assets/fabric_semantic_model_table.py index 4d37fe8da..b8855ebfe 100644 --- a/pyatlan_v9/model/assets/fabric_semantic_model_table.py +++ b/pyatlan_v9/model/assets/fabric_semantic_model_table.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,12 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import ( + RelatedFabricSemanticModel, + RelatedFabricSemanticModelMeasure, + RelatedFabricSemanticModelTable, + RelatedFabricSemanticModelTableColumn, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,19 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import ( - RelatedFabricSemanticModel, - RelatedFabricSemanticModelMeasure, - RelatedFabricSemanticModelTable, - RelatedFabricSemanticModelTableColumn, -) # ============================================================================= # FLAT ASSET CLASS @@ -686,33 +686,36 @@ def _fabric_semantic_model_table_from_nested( _FABRIC_SEMANTIC_MODEL_TABLE_REL_FIELDS, FabricSemanticModelTableRelationshipAttributes, ) - return FabricSemanticModelTable( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_semantic_model_table_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_semantic_model_table_attrs(attrs)) + kwargs.update(merged_rels) + return FabricSemanticModelTable(**kwargs) def _fabric_semantic_model_table_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/fabric_semantic_model_table_column.py b/pyatlan_v9/model/assets/fabric_semantic_model_table_column.py index 5f2ea79a1..4ac54120f 100644 --- a/pyatlan_v9/model/assets/fabric_semantic_model_table_column.py +++ b/pyatlan_v9/model/assets/fabric_semantic_model_table_column.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,11 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import ( + RelatedFabricSemanticModelMeasure, + RelatedFabricSemanticModelTable, + RelatedFabricSemanticModelTableColumn, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import ( - RelatedFabricSemanticModelMeasure, - RelatedFabricSemanticModelTable, - RelatedFabricSemanticModelTableColumn, -) # ============================================================================= # FLAT ASSET CLASS @@ -694,33 +694,36 @@ def _fabric_semantic_model_table_column_from_nested( _FABRIC_SEMANTIC_MODEL_TABLE_COLUMN_REL_FIELDS, FabricSemanticModelTableColumnRelationshipAttributes, ) - return FabricSemanticModelTableColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_semantic_model_table_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_semantic_model_table_column_attrs(attrs)) + kwargs.update(merged_rels) + return FabricSemanticModelTableColumn(**kwargs) def _fabric_semantic_model_table_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/fabric_visual.py b/pyatlan_v9/model/assets/fabric_visual.py index 32d1902a1..89e5272ce 100644 --- a/pyatlan_v9/model/assets/fabric_visual.py +++ b/pyatlan_v9/model/assets/fabric_visual.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import RelatedFabricPage, RelatedFabricVisual from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import RelatedFabricPage, RelatedFabricVisual # ============================================================================= # FLAT ASSET CLASS @@ -659,33 +659,36 @@ def _fabric_visual_from_nested(nested: FabricVisualNested) -> FabricVisual: _FABRIC_VISUAL_REL_FIELDS, FabricVisualRelationshipAttributes, ) - return FabricVisual( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_visual_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_visual_attrs(attrs)) + kwargs.update(merged_rels) + return FabricVisual(**kwargs) def _fabric_visual_to_nested_bytes(fabric_visual: FabricVisual, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/fabric_workspace.py b/pyatlan_v9/model/assets/fabric_workspace.py index dab9d0a9a..d1d48300d 100644 --- a/pyatlan_v9/model/assets/fabric_workspace.py +++ b/pyatlan_v9/model/assets/fabric_workspace.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,14 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fabric_related import ( + RelatedFabricDashboard, + RelatedFabricDataflow, + RelatedFabricDataPipeline, + RelatedFabricReport, + RelatedFabricSemanticModel, + RelatedFabricWorkspace, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,21 +62,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedDatabase -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fabric_related import ( - RelatedFabricDashboard, - RelatedFabricDataPipeline, - RelatedFabricDataflow, - RelatedFabricReport, - RelatedFabricSemanticModel, - RelatedFabricWorkspace, -) # ============================================================================= # FLAT ASSET CLASS @@ -675,33 +675,36 @@ def _fabric_workspace_from_nested(nested: FabricWorkspaceNested) -> FabricWorksp _FABRIC_WORKSPACE_REL_FIELDS, FabricWorkspaceRelationshipAttributes, ) - return FabricWorkspace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fabric_workspace_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fabric_workspace_attrs(attrs)) + kwargs.update(merged_rels) + return FabricWorkspace(**kwargs) def _fabric_workspace_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/file.py b/pyatlan_v9/model/assets/file.py index 7b591827c..a2dccf8b0 100644 --- a/pyatlan_v9/model/assets/file.py +++ b/pyatlan_v9/model/assets/file.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,18 +51,10 @@ from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .resource_related import RelatedFile, RelatedLink, RelatedReadme # ============================================================================= # FLAT ASSET CLASS @@ -727,33 +727,36 @@ def _file_from_nested(nested: FileNested) -> File: _FILE_REL_FIELDS, FileRelationshipAttributes, ) - return File( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_file_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_file_attrs(attrs)) + kwargs.update(merged_rels) + return File(**kwargs) def _file_to_nested_bytes(file: File, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/fivetran.py b/pyatlan_v9/model/assets/fivetran.py index 35af2b8cc..da1f4ae0a 100644 --- a/pyatlan_v9/model/assets/fivetran.py +++ b/pyatlan_v9/model/assets/fivetran.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fivetran_related import RelatedFivetran from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fivetran_related import RelatedFivetran # ============================================================================= # FLAT ASSET CLASS @@ -601,33 +601,36 @@ def _fivetran_from_nested(nested: FivetranNested) -> Fivetran: _FIVETRAN_REL_FIELDS, FivetranRelationshipAttributes, ) - return Fivetran( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fivetran_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fivetran_attrs(attrs)) + kwargs.update(merged_rels) + return Fivetran(**kwargs) def _fivetran_to_nested_bytes(fivetran: Fivetran, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/fivetran_connector.py b/pyatlan_v9/model/assets/fivetran_connector.py index 879fefd40..f0d5f87ff 100644 --- a/pyatlan_v9/model/assets/fivetran_connector.py +++ b/pyatlan_v9/model/assets/fivetran_connector.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .fivetran_related import RelatedFivetranConnector from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .fivetran_related import RelatedFivetranConnector # ============================================================================= # FLAT ASSET CLASS @@ -1146,33 +1146,36 @@ def _fivetran_connector_from_nested( _FIVETRAN_CONNECTOR_REL_FIELDS, FivetranConnectorRelationshipAttributes, ) - return FivetranConnector( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_fivetran_connector_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_fivetran_connector_attrs(attrs)) + kwargs.update(merged_rels) + return FivetranConnector(**kwargs) def _fivetran_connector_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/flow.py b/pyatlan_v9/model/assets/flow.py index 1ef5cf842..8d718e483 100644 --- a/pyatlan_v9/model/assets/flow.py +++ b/pyatlan_v9/model/assets/flow.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -33,6 +40,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .flow_related import RelatedFlow from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -41,14 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .flow_related import RelatedFlow # ============================================================================= # FLAT ASSET CLASS @@ -596,33 +596,36 @@ def _flow_from_nested(nested: FlowNested) -> Flow: _FLOW_REL_FIELDS, FlowRelationshipAttributes, ) - return Flow( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_flow_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_flow_attrs(attrs)) + kwargs.update(merged_rels) + return Flow(**kwargs) def _flow_to_nested_bytes(flow: Flow, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/flow_control_operation.py b/pyatlan_v9/model/assets/flow_control_operation.py index 6a22372ce..e4a382596 100644 --- a/pyatlan_v9/model/assets/flow_control_operation.py +++ b/pyatlan_v9/model/assets/flow_control_operation.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .flow_related import RelatedFlowControlOperation from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -43,14 +51,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .flow_related import RelatedFlowControlOperation # ============================================================================= # FLAT ASSET CLASS @@ -674,33 +674,36 @@ def _flow_control_operation_from_nested( _FLOW_CONTROL_OPERATION_REL_FIELDS, FlowControlOperationRelationshipAttributes, ) - return FlowControlOperation( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_flow_control_operation_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_flow_control_operation_attrs(attrs)) + kwargs.update(merged_rels) + return FlowControlOperation(**kwargs) def _flow_control_operation_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/flow_dataset.py b/pyatlan_v9/model/assets/flow_dataset.py index f7d46c2bd..155134f01 100644 --- a/pyatlan_v9/model/assets/flow_dataset.py +++ b/pyatlan_v9/model/assets/flow_dataset.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .flow_related import RelatedFlowDataset, RelatedFlowField, RelatedFlowReusableUnit from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .flow_related import RelatedFlowDataset, RelatedFlowField, RelatedFlowReusableUnit # ============================================================================= # FLAT ASSET CLASS @@ -781,33 +781,36 @@ def _flow_dataset_from_nested(nested: FlowDatasetNested) -> FlowDataset: _FLOW_DATASET_REL_FIELDS, FlowDatasetRelationshipAttributes, ) - return FlowDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_flow_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_flow_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return FlowDataset(**kwargs) def _flow_dataset_to_nested_bytes(flow_dataset: FlowDataset, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/flow_dataset_operation.py b/pyatlan_v9/model/assets/flow_dataset_operation.py index 36769b176..53b811804 100644 --- a/pyatlan_v9/model/assets/flow_dataset_operation.py +++ b/pyatlan_v9/model/assets/flow_dataset_operation.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .adf_related import RelatedAdfActivity from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -41,6 +48,11 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .fabric_related import RelatedFabricActivity from .fivetran_related import RelatedFivetranConnector +from .flow_related import ( + RelatedFlowControlOperation, + RelatedFlowDatasetOperation, + RelatedFlowReusableUnit, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -54,18 +66,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedFunction, RelatedProcedure -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .flow_related import ( - RelatedFlowControlOperation, - RelatedFlowDatasetOperation, - RelatedFlowReusableUnit, -) # ============================================================================= # FLAT ASSET CLASS @@ -853,33 +853,36 @@ def _flow_dataset_operation_from_nested( _FLOW_DATASET_OPERATION_REL_FIELDS, FlowDatasetOperationRelationshipAttributes, ) - return FlowDatasetOperation( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_flow_dataset_operation_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_flow_dataset_operation_attrs(attrs)) + kwargs.update(merged_rels) + return FlowDatasetOperation(**kwargs) def _flow_dataset_operation_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/flow_field.py b/pyatlan_v9/model/assets/flow_field.py index 50b9328c0..748025526 100644 --- a/pyatlan_v9/model/assets/flow_field.py +++ b/pyatlan_v9/model/assets/flow_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .flow_related import RelatedFlowDataset, RelatedFlowField from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .flow_related import RelatedFlowDataset, RelatedFlowField # ============================================================================= # FLAT ASSET CLASS @@ -769,33 +769,36 @@ def _flow_field_from_nested(nested: FlowFieldNested) -> FlowField: _FLOW_FIELD_REL_FIELDS, FlowFieldRelationshipAttributes, ) - return FlowField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_flow_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_flow_field_attrs(attrs)) + kwargs.update(merged_rels) + return FlowField(**kwargs) def _flow_field_to_nested_bytes(flow_field: FlowField, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/flow_field_operation.py b/pyatlan_v9/model/assets/flow_field_operation.py index 15729cfab..5969d4eee 100644 --- a/pyatlan_v9/model/assets/flow_field_operation.py +++ b/pyatlan_v9/model/assets/flow_field_operation.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .adf_related import RelatedAdfActivity from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -40,6 +47,7 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .fabric_related import RelatedFabricActivity from .fivetran_related import RelatedFivetranConnector +from .flow_related import RelatedFlowControlOperation, RelatedFlowFieldOperation from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -53,14 +61,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedFunction, RelatedProcedure -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .flow_related import RelatedFlowControlOperation, RelatedFlowFieldOperation # ============================================================================= # FLAT ASSET CLASS @@ -828,33 +828,36 @@ def _flow_field_operation_from_nested( _FLOW_FIELD_OPERATION_REL_FIELDS, FlowFieldOperationRelationshipAttributes, ) - return FlowFieldOperation( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_flow_field_operation_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_flow_field_operation_attrs(attrs)) + kwargs.update(merged_rels) + return FlowFieldOperation(**kwargs) def _flow_field_operation_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/flow_folder.py b/pyatlan_v9/model/assets/flow_folder.py index 4714eb3b4..7f606631b 100644 --- a/pyatlan_v9/model/assets/flow_folder.py +++ b/pyatlan_v9/model/assets/flow_folder.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .flow_related import RelatedFlowFolder from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -42,14 +50,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .flow_related import RelatedFlowFolder # ============================================================================= # FLAT ASSET CLASS @@ -629,33 +629,36 @@ def _flow_folder_from_nested(nested: FlowFolderNested) -> FlowFolder: _FLOW_FOLDER_REL_FIELDS, FlowFolderRelationshipAttributes, ) - return FlowFolder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_flow_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_flow_folder_attrs(attrs)) + kwargs.update(merged_rels) + return FlowFolder(**kwargs) def _flow_folder_to_nested_bytes(flow_folder: FlowFolder, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/flow_project.py b/pyatlan_v9/model/assets/flow_project.py index 179412356..646806a5f 100644 --- a/pyatlan_v9/model/assets/flow_project.py +++ b/pyatlan_v9/model/assets/flow_project.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -33,6 +40,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .flow_related import RelatedFlowProject from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -41,14 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .flow_related import RelatedFlowProject # ============================================================================= # FLAT ASSET CLASS @@ -604,33 +604,36 @@ def _flow_project_from_nested(nested: FlowProjectNested) -> FlowProject: _FLOW_PROJECT_REL_FIELDS, FlowProjectRelationshipAttributes, ) - return FlowProject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_flow_project_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_flow_project_attrs(attrs)) + kwargs.update(merged_rels) + return FlowProject(**kwargs) def _flow_project_to_nested_bytes(flow_project: FlowProject, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/flow_reusable_unit.py b/pyatlan_v9/model/assets/flow_reusable_unit.py index d547a07a7..618551bf2 100644 --- a/pyatlan_v9/model/assets/flow_reusable_unit.py +++ b/pyatlan_v9/model/assets/flow_reusable_unit.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -33,6 +40,11 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .flow_related import ( + RelatedFlowDataset, + RelatedFlowDatasetOperation, + RelatedFlowReusableUnit, +) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -41,18 +53,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .flow_related import ( - RelatedFlowDataset, - RelatedFlowDatasetOperation, - RelatedFlowReusableUnit, -) # ============================================================================= # FLAT ASSET CLASS @@ -660,33 +660,36 @@ def _flow_reusable_unit_from_nested(nested: FlowReusableUnitNested) -> FlowReusa _FLOW_REUSABLE_UNIT_REL_FIELDS, FlowReusableUnitRelationshipAttributes, ) - return FlowReusableUnit( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_flow_reusable_unit_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_flow_reusable_unit_attrs(attrs)) + kwargs.update(merged_rels) + return FlowReusableUnit(**kwargs) def _flow_reusable_unit_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/folder.py b/pyatlan_v9/model/assets/folder.py index 6ac75023e..fdbd5355d 100644 --- a/pyatlan_v9/model/assets/folder.py +++ b/pyatlan_v9/model/assets/folder.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan.utils import validate_required_fields +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -38,20 +46,12 @@ from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .namespace_related import RelatedFolder, RelatedNamespace from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .sql_related import RelatedQuery -from pyatlan.utils import validate_required_fields -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .namespace_related import RelatedFolder, RelatedNamespace # ============================================================================= # FLAT ASSET CLASS @@ -571,33 +571,36 @@ def _folder_from_nested(nested: FolderNested) -> Folder: _FOLDER_REL_FIELDS, FolderRelationshipAttributes, ) - return Folder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_folder_attrs(attrs)) + kwargs.update(merged_rels) + return Folder(**kwargs) def _folder_to_nested_bytes(folder: Folder, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/form.py b/pyatlan_v9/model/assets/form.py index 8295986be..4d780fafb 100644 --- a/pyatlan_v9/model/assets/form.py +++ b/pyatlan_v9/model/assets/form.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -33,6 +40,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .form_related import RelatedForm from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -41,14 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .form_related import RelatedForm # ============================================================================= # FLAT ASSET CLASS @@ -486,33 +486,36 @@ def _form_from_nested(nested: FormNested) -> Form: _FORM_REL_FIELDS, FormRelationshipAttributes, ) - return Form( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_form_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_form_attrs(attrs)) + kwargs.update(merged_rels) + return Form(**kwargs) def _form_to_nested_bytes(form: Form, serde: Serde) -> bytes: @@ -529,10 +532,7 @@ def _form_from_nested_bytes(data: bytes, serde: Serde) -> Form: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Form.FORM_FIELDS = KeywordField("formFields", "formFields") Form.FORM_OPTIONS = KeywordField("formOptions", "formOptions") diff --git a/pyatlan_v9/model/assets/function.py b/pyatlan_v9/model/assets/function.py index c51c4b82b..4b72e752c 100644 --- a/pyatlan_v9/model/assets/function.py +++ b/pyatlan_v9/model/assets/function.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -60,13 +67,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sql_related import RelatedFunction, RelatedSchema # ============================================================================= @@ -1185,33 +1185,36 @@ def _function_from_nested(nested: FunctionNested) -> Function: _FUNCTION_REL_FIELDS, FunctionRelationshipAttributes, ) - return Function( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_function_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_function_attrs(attrs)) + kwargs.update(merged_rels) + return Function(**kwargs) def _function_to_nested_bytes(function: Function, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/gcp_dataplex.py b/pyatlan_v9/model/assets/gcp_dataplex.py index 2b9b644c1..ee9f9d96b 100644 --- a/pyatlan_v9/model/assets/gcp_dataplex.py +++ b/pyatlan_v9/model/assets/gcp_dataplex.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -33,6 +40,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .gcp_dataplex_related import RelatedGCPDataplex, RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -40,14 +48,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .gcp_dataplex_related import RelatedGCPDataplex, RelatedGCPDataplexAspectType # ============================================================================= # FLAT ASSET CLASS @@ -556,33 +556,36 @@ def _gcp_dataplex_from_nested(nested: GCPDataplexNested) -> GCPDataplex: _GCP_DATAPLEX_REL_FIELDS, GCPDataplexRelationshipAttributes, ) - return GCPDataplex( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_gcp_dataplex_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_gcp_dataplex_attrs(attrs)) + kwargs.update(merged_rels) + return GCPDataplex(**kwargs) def _gcp_dataplex_to_nested_bytes(gcp_dataplex: GCPDataplex, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/gcp_dataplex_aspect_type.py b/pyatlan_v9/model/assets/gcp_dataplex_aspect_type.py index e54ee3e3a..36b35625d 100644 --- a/pyatlan_v9/model/assets/gcp_dataplex_aspect_type.py +++ b/pyatlan_v9/model/assets/gcp_dataplex_aspect_type.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -34,6 +41,7 @@ from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric +from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -41,14 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .gcp_dataplex_related import RelatedGCPDataplexAspectType # ============================================================================= # FLAT ASSET CLASS @@ -634,33 +634,36 @@ def _gcp_dataplex_aspect_type_from_nested( _GCP_DATAPLEX_ASPECT_TYPE_REL_FIELDS, GCPDataplexAspectTypeRelationshipAttributes, ) - return GCPDataplexAspectType( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_gcp_dataplex_aspect_type_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_gcp_dataplex_aspect_type_attrs(attrs)) + kwargs.update(merged_rels) + return GCPDataplexAspectType(**kwargs) def _gcp_dataplex_aspect_type_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/gcs.py b/pyatlan_v9/model/assets/gcs.py index e6693a5eb..ddb6eab25 100644 --- a/pyatlan_v9/model/assets/gcs.py +++ b/pyatlan_v9/model/assets/gcs.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,7 @@ from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType +from .gcs_related import RelatedGCS from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .gcs_related import RelatedGCS # ============================================================================= # FLAT ASSET CLASS @@ -702,33 +702,36 @@ def _gcs_from_nested(nested: GCSNested) -> GCS: _GCS_REL_FIELDS, GCSRelationshipAttributes, ) - return GCS( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_gcs_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_gcs_attrs(attrs)) + kwargs.update(merged_rels) + return GCS(**kwargs) def _gcs_to_nested_bytes(gcs: GCS, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/gcs_bucket.py b/pyatlan_v9/model/assets/gcs_bucket.py index 491383c1d..76fcb752d 100644 --- a/pyatlan_v9/model/assets/gcs_bucket.py +++ b/pyatlan_v9/model/assets/gcs_bucket.py @@ -19,6 +19,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +44,7 @@ from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType +from .gcs_related import RelatedGCSBucket, RelatedGCSObject from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity @@ -47,15 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .gcs_related import RelatedGCSBucket, RelatedGCSObject # ============================================================================= # FLAT ASSET CLASS @@ -837,33 +837,36 @@ def _gcs_bucket_from_nested(nested: GCSBucketNested) -> GCSBucket: _GCS_BUCKET_REL_FIELDS, GCSBucketRelationshipAttributes, ) - return GCSBucket( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_gcs_bucket_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_gcs_bucket_attrs(attrs)) + kwargs.update(merged_rels) + return GCSBucket(**kwargs) def _gcs_bucket_to_nested_bytes(gcs_bucket: GCSBucket, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/gcs_object.py b/pyatlan_v9/model/assets/gcs_object.py index 3955c8daf..4f69b7398 100644 --- a/pyatlan_v9/model/assets/gcs_object.py +++ b/pyatlan_v9/model/assets/gcs_object.py @@ -20,6 +20,15 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan.model.utils import construct_object_key +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +46,7 @@ from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType +from .gcs_related import RelatedGCSBucket, RelatedGCSObject from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity @@ -48,16 +58,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.utils import construct_object_key -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .gcs_related import RelatedGCSBucket, RelatedGCSObject # ============================================================================= # FLAT ASSET CLASS @@ -1020,33 +1020,36 @@ def _gcs_object_from_nested(nested: GCSObjectNested) -> GCSObject: _GCS_OBJECT_REL_FIELDS, GCSObjectRelationshipAttributes, ) - return GCSObject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_gcs_object_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_gcs_object_attrs(attrs)) + kwargs.update(merged_rels) + return GCSObject(**kwargs) def _gcs_object_to_nested_bytes(gcs_object: GCSObject, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/google.py b/pyatlan_v9/model/assets/google.py index cffae5011..19c4c9941 100644 --- a/pyatlan_v9/model/assets/google.py +++ b/pyatlan_v9/model/assets/google.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -29,6 +36,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .cloud_related import RelatedGoogle from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -41,14 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cloud_related import RelatedGoogle # ============================================================================= # FLAT ASSET CLASS @@ -553,33 +553,36 @@ def _google_from_nested(nested: GoogleNested) -> Google: _GOOGLE_REL_FIELDS, GoogleRelationshipAttributes, ) - return Google( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_google_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_google_attrs(attrs)) + kwargs.update(merged_rels) + return Google(**kwargs) def _google_to_nested_bytes(google: Google, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/iceberg.py b/pyatlan_v9/model/assets/iceberg.py index 040140d48..5497778c3 100644 --- a/pyatlan_v9/model/assets/iceberg.py +++ b/pyatlan_v9/model/assets/iceberg.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,6 +50,7 @@ ) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .iceberg_related import RelatedIceberg from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -58,14 +66,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .iceberg_related import RelatedIceberg # ============================================================================= # FLAT ASSET CLASS @@ -1019,33 +1019,36 @@ def _iceberg_from_nested(nested: IcebergNested) -> Iceberg: _ICEBERG_REL_FIELDS, IcebergRelationshipAttributes, ) - return Iceberg( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_iceberg_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_iceberg_attrs(attrs)) + kwargs.update(merged_rels) + return Iceberg(**kwargs) def _iceberg_to_nested_bytes(iceberg: Iceberg, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/iceberg_catalog.py b/pyatlan_v9/model/assets/iceberg_catalog.py index d52b0b540..f74e915c8 100644 --- a/pyatlan_v9/model/assets/iceberg_catalog.py +++ b/pyatlan_v9/model/assets/iceberg_catalog.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,6 +51,7 @@ from .fabric_related import RelatedFabricWorkspace from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .iceberg_related import RelatedIcebergCatalog from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -60,14 +68,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .iceberg_related import RelatedIcebergCatalog # ============================================================================= # FLAT ASSET CLASS @@ -1127,33 +1127,36 @@ def _iceberg_catalog_from_nested(nested: IcebergCatalogNested) -> IcebergCatalog _ICEBERG_CATALOG_REL_FIELDS, IcebergCatalogRelationshipAttributes, ) - return IcebergCatalog( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_iceberg_catalog_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_iceberg_catalog_attrs(attrs)) + kwargs.update(merged_rels) + return IcebergCatalog(**kwargs) def _iceberg_catalog_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/iceberg_column.py b/pyatlan_v9/model/assets/iceberg_column.py index 84e8d4f50..6692623b8 100644 --- a/pyatlan_v9/model/assets/iceberg_column.py +++ b/pyatlan_v9/model/assets/iceberg_column.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,6 +53,7 @@ ) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .iceberg_related import RelatedIcebergColumn from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .mongo_db_related import RelatedMongoDBCollection @@ -75,14 +83,6 @@ RelatedTablePartition, RelatedView, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .iceberg_related import RelatedIcebergColumn # ============================================================================= # FLAT ASSET CLASS @@ -1917,33 +1917,36 @@ def _iceberg_column_from_nested(nested: IcebergColumnNested) -> IcebergColumn: _ICEBERG_COLUMN_REL_FIELDS, IcebergColumnRelationshipAttributes, ) - return IcebergColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_iceberg_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_iceberg_column_attrs(attrs)) + kwargs.update(merged_rels) + return IcebergColumn(**kwargs) def _iceberg_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/iceberg_namespace.py b/pyatlan_v9/model/assets/iceberg_namespace.py index b2bdb7f2a..44c2cd057 100644 --- a/pyatlan_v9/model/assets/iceberg_namespace.py +++ b/pyatlan_v9/model/assets/iceberg_namespace.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,6 +53,7 @@ ) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .iceberg_related import RelatedIcebergNamespace from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -80,14 +88,6 @@ RelatedTable, RelatedView, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .iceberg_related import RelatedIcebergNamespace # ============================================================================= # FLAT ASSET CLASS @@ -1293,33 +1293,36 @@ def _iceberg_namespace_from_nested(nested: IcebergNamespaceNested) -> IcebergNam _ICEBERG_NAMESPACE_REL_FIELDS, IcebergNamespaceRelationshipAttributes, ) - return IcebergNamespace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_iceberg_namespace_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_iceberg_namespace_attrs(attrs)) + kwargs.update(merged_rels) + return IcebergNamespace(**kwargs) def _iceberg_namespace_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/iceberg_table.py b/pyatlan_v9/model/assets/iceberg_table.py index 480179fa7..b4f53afd2 100644 --- a/pyatlan_v9/model/assets/iceberg_table.py +++ b/pyatlan_v9/model/assets/iceberg_table.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,6 +50,7 @@ ) from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .iceberg_related import RelatedIcebergTable from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -65,14 +73,6 @@ RelatedTable, RelatedTablePartition, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .iceberg_related import RelatedIcebergTable # ============================================================================= # FLAT ASSET CLASS @@ -1370,33 +1370,36 @@ def _iceberg_table_from_nested(nested: IcebergTableNested) -> IcebergTable: _ICEBERG_TABLE_REL_FIELDS, IcebergTableRelationshipAttributes, ) - return IcebergTable( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_iceberg_table_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_iceberg_table_attrs(attrs)) + kwargs.update(merged_rels) + return IcebergTable(**kwargs) def _iceberg_table_to_nested_bytes(iceberg_table: IcebergTable, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/incident.py b/pyatlan_v9/model/assets/incident.py index ab848e2bc..863f492ca 100644 --- a/pyatlan_v9/model/assets/incident.py +++ b/pyatlan_v9/model/assets/incident.py @@ -19,8 +19,15 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField +from .asset_related import RelatedIncident from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -42,13 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde - -from .asset_related import RelatedIncident # ============================================================================= # FLAT ASSET CLASS @@ -2657,33 +2657,36 @@ def _incident_from_nested(nested: IncidentNested) -> Incident: _INCIDENT_REL_FIELDS, IncidentRelationshipAttributes, ) - return Incident( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_incident_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_incident_attrs(attrs)) + kwargs.update(merged_rels) + return Incident(**kwargs) def _incident_to_nested_bytes(incident: Incident, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/infrastructure.py b/pyatlan_v9/model/assets/infrastructure.py index 7bd5046ec..94d227fc9 100644 --- a/pyatlan_v9/model/assets/infrastructure.py +++ b/pyatlan_v9/model/assets/infrastructure.py @@ -19,8 +19,15 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField +from .asset_related import RelatedInfrastructure from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -42,13 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde - -from .asset_related import RelatedInfrastructure # ============================================================================= # FLAT ASSET CLASS @@ -2654,33 +2654,36 @@ def _infrastructure_from_nested(nested: InfrastructureNested) -> Infrastructure: _INFRASTRUCTURE_REL_FIELDS, InfrastructureRelationshipAttributes, ) - return Infrastructure( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_infrastructure_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_infrastructure_attrs(attrs)) + kwargs.update(merged_rels) + return Infrastructure(**kwargs) def _infrastructure_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/insight.py b/pyatlan_v9/model/assets/insight.py index b15117139..a25e05243 100644 --- a/pyatlan_v9/model/assets/insight.py +++ b/pyatlan_v9/model/assets/insight.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .catalog_related import RelatedInsight from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .catalog_related import RelatedInsight # ============================================================================= # FLAT ASSET CLASS @@ -570,33 +570,36 @@ def _insight_from_nested(nested: InsightNested) -> Insight: _INSIGHT_REL_FIELDS, InsightRelationshipAttributes, ) - return Insight( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_insight_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_insight_attrs(attrs)) + kwargs.update(merged_rels) + return Insight(**kwargs) def _insight_to_nested_bytes(insight: Insight, serde: Serde) -> bytes: @@ -613,10 +616,7 @@ def _insight_from_nested_bytes(data: bytes, serde: Serde) -> Insight: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Insight.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") Insight.INPUT_TO_AIRFLOW_TASKS = RelationField("inputToAirflowTasks") diff --git a/pyatlan_v9/model/assets/kafka.py b/pyatlan_v9/model/assets/kafka.py index e25a7d353..0a483189f 100644 --- a/pyatlan_v9/model/assets/kafka.py +++ b/pyatlan_v9/model/assets/kafka.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,7 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .kafka_related import RelatedKafka from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .kafka_related import RelatedKafka # ============================================================================= # FLAT ASSET CLASS @@ -570,33 +570,36 @@ def _kafka_from_nested(nested: KafkaNested) -> Kafka: _KAFKA_REL_FIELDS, KafkaRelationshipAttributes, ) - return Kafka( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_kafka_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_kafka_attrs(attrs)) + kwargs.update(merged_rels) + return Kafka(**kwargs) def _kafka_to_nested_bytes(kafka: Kafka, serde: Serde) -> bytes: @@ -613,10 +616,7 @@ def _kafka_from_nested_bytes(data: bytes, serde: Serde) -> Kafka: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Kafka.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") Kafka.INPUT_TO_AIRFLOW_TASKS = RelationField("inputToAirflowTasks") diff --git a/pyatlan_v9/model/assets/kafka_cluster.py b/pyatlan_v9/model/assets/kafka_cluster.py index 322b287cc..0db58b420 100644 --- a/pyatlan_v9/model/assets/kafka_cluster.py +++ b/pyatlan_v9/model/assets/kafka_cluster.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .kafka_related import RelatedKafkaCluster, RelatedKafkaTopic from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .kafka_related import RelatedKafkaCluster, RelatedKafkaTopic # ============================================================================= # FLAT ASSET CLASS @@ -666,33 +666,36 @@ def _kafka_cluster_from_nested(nested: KafkaClusterNested) -> KafkaCluster: _KAFKA_CLUSTER_REL_FIELDS, KafkaClusterRelationshipAttributes, ) - return KafkaCluster( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_kafka_cluster_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_kafka_cluster_attrs(attrs)) + kwargs.update(merged_rels) + return KafkaCluster(**kwargs) def _kafka_cluster_to_nested_bytes(kafka_cluster: KafkaCluster, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/kafka_consumer_group.py b/pyatlan_v9/model/assets/kafka_consumer_group.py index a335f9090..f90831395 100644 --- a/pyatlan_v9/model/assets/kafka_consumer_group.py +++ b/pyatlan_v9/model/assets/kafka_consumer_group.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +45,7 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .kafka_related import RelatedKafkaConsumerGroup, RelatedKafkaTopic from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -47,15 +56,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .kafka_related import RelatedKafkaConsumerGroup, RelatedKafkaTopic # ============================================================================= # FLAT ASSET CLASS @@ -718,33 +718,36 @@ def _kafka_consumer_group_from_nested( _KAFKA_CONSUMER_GROUP_REL_FIELDS, KafkaConsumerGroupRelationshipAttributes, ) - return KafkaConsumerGroup( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_kafka_consumer_group_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_kafka_consumer_group_attrs(attrs)) + kwargs.update(merged_rels) + return KafkaConsumerGroup(**kwargs) def _kafka_consumer_group_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/kafka_field.py b/pyatlan_v9/model/assets/kafka_field.py index ead7b026f..f88e47810 100644 --- a/pyatlan_v9/model/assets/kafka_field.py +++ b/pyatlan_v9/model/assets/kafka_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .kafka_related import RelatedKafkaField, RelatedKafkaTopic from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .kafka_related import RelatedKafkaField, RelatedKafkaTopic # ============================================================================= # FLAT ASSET CLASS @@ -741,33 +741,36 @@ def _kafka_field_from_nested(nested: KafkaFieldNested) -> KafkaField: _KAFKA_FIELD_REL_FIELDS, KafkaFieldRelationshipAttributes, ) - return KafkaField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_kafka_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_kafka_field_attrs(attrs)) + kwargs.update(merged_rels) + return KafkaField(**kwargs) def _kafka_field_to_nested_bytes(kafka_field: KafkaField, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/kafka_tag.py b/pyatlan_v9/model/assets/kafka_tag.py index dc3fbaf46..76bc8dc3b 100644 --- a/pyatlan_v9/model/assets/kafka_tag.py +++ b/pyatlan_v9/model/assets/kafka_tag.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .kafka_related import RelatedKafkaTag from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .kafka_related import RelatedKafkaTag # ============================================================================= # FLAT ASSET CLASS @@ -623,33 +623,36 @@ def _kafka_tag_from_nested(nested: KafkaTagNested) -> KafkaTag: _KAFKA_TAG_REL_FIELDS, KafkaTagRelationshipAttributes, ) - return KafkaTag( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_kafka_tag_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_kafka_tag_attrs(attrs)) + kwargs.update(merged_rels) + return KafkaTag(**kwargs) def _kafka_tag_to_nested_bytes(kafka_tag: KafkaTag, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/kafka_topic.py b/pyatlan_v9/model/assets/kafka_topic.py index bcbb175e5..656de00ef 100644 --- a/pyatlan_v9/model/assets/kafka_topic.py +++ b/pyatlan_v9/model/assets/kafka_topic.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +45,12 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .kafka_related import ( + RelatedKafkaCluster, + RelatedKafkaConsumerGroup, + RelatedKafkaField, + RelatedKafkaTopic, +) from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor @@ -47,20 +61,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .kafka_related import ( - RelatedKafkaCluster, - RelatedKafkaConsumerGroup, - RelatedKafkaField, - RelatedKafkaTopic, -) # ============================================================================= # FLAT ASSET CLASS @@ -790,33 +790,36 @@ def _kafka_topic_from_nested(nested: KafkaTopicNested) -> KafkaTopic: _KAFKA_TOPIC_REL_FIELDS, KafkaTopicRelationshipAttributes, ) - return KafkaTopic( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_kafka_topic_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_kafka_topic_attrs(attrs)) + kwargs.update(merged_rels) + return KafkaTopic(**kwargs) def _kafka_topic_to_nested_bytes(kafka_topic: KafkaTopic, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/knowledge.py b/pyatlan_v9/model/assets/knowledge.py index 2189860a8..fbe0bdcd1 100644 --- a/pyatlan_v9/model/assets/knowledge.py +++ b/pyatlan_v9/model/assets/knowledge.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,7 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .knowledge_related import RelatedKnowledge, RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -45,14 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .knowledge_related import RelatedKnowledge, RelatedKnowledgeFile # ============================================================================= # FLAT ASSET CLASS @@ -589,33 +589,36 @@ def _knowledge_from_nested(nested: KnowledgeNested) -> Knowledge: _KNOWLEDGE_REL_FIELDS, KnowledgeRelationshipAttributes, ) - return Knowledge( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_knowledge_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_knowledge_attrs(attrs)) + kwargs.update(merged_rels) + return Knowledge(**kwargs) def _knowledge_to_nested_bytes(knowledge: Knowledge, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/knowledge_file.py b/pyatlan_v9/model/assets/knowledge_file.py index 202330053..b170347fa 100644 --- a/pyatlan_v9/model/assets/knowledge_file.py +++ b/pyatlan_v9/model/assets/knowledge_file.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .knowledge_related import RelatedKnowledgeFile, RelatedKnowledgeFolder from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .knowledge_related import RelatedKnowledgeFile, RelatedKnowledgeFolder # ============================================================================= # FLAT ASSET CLASS @@ -713,33 +713,36 @@ def _knowledge_file_from_nested(nested: KnowledgeFileNested) -> KnowledgeFile: _KNOWLEDGE_FILE_REL_FIELDS, KnowledgeFileRelationshipAttributes, ) - return KnowledgeFile( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_knowledge_file_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_knowledge_file_attrs(attrs)) + kwargs.update(merged_rels) + return KnowledgeFile(**kwargs) def _knowledge_file_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/knowledge_folder.py b/pyatlan_v9/model/assets/knowledge_folder.py index 9cfae797a..796f7ef30 100644 --- a/pyatlan_v9/model/assets/knowledge_folder.py +++ b/pyatlan_v9/model/assets/knowledge_folder.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -36,6 +43,7 @@ from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm +from .knowledge_related import RelatedKnowledgeFile, RelatedKnowledgeFolder from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -45,14 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .knowledge_related import RelatedKnowledgeFile, RelatedKnowledgeFolder # ============================================================================= # FLAT ASSET CLASS @@ -618,33 +618,36 @@ def _knowledge_folder_from_nested(nested: KnowledgeFolderNested) -> KnowledgeFol _KNOWLEDGE_FOLDER_REL_FIELDS, KnowledgeFolderRelationshipAttributes, ) - return KnowledgeFolder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_knowledge_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_knowledge_folder_attrs(attrs)) + kwargs.update(merged_rels) + return KnowledgeFolder(**kwargs) def _knowledge_folder_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/link.py b/pyatlan_v9/model/assets/link.py index 6324dd6ea..99d5216da 100644 --- a/pyatlan_v9/model/assets/link.py +++ b/pyatlan_v9/model/assets/link.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,17 +50,10 @@ from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .resource_related import RelatedFile, RelatedLink, RelatedReadme # ============================================================================= # FLAT ASSET CLASS @@ -628,33 +628,36 @@ def _link_from_nested(nested: LinkNested) -> Link: _LINK_REL_FIELDS, LinkRelationshipAttributes, ) - return Link( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_link_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_link_attrs(attrs)) + kwargs.update(merged_rels) + return Link(**kwargs) def _link_to_nested_bytes(link: Link, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/looker.py b/pyatlan_v9/model/assets/looker.py index 116128264..ff4042ee4 100644 --- a/pyatlan_v9/model/assets/looker.py +++ b/pyatlan_v9/model/assets/looker.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .looker_related import RelatedLooker from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .looker_related import RelatedLooker # ============================================================================= # FLAT ASSET CLASS @@ -579,33 +579,36 @@ def _looker_from_nested(nested: LookerNested) -> Looker: _LOOKER_REL_FIELDS, LookerRelationshipAttributes, ) - return Looker( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_attrs(attrs)) + kwargs.update(merged_rels) + return Looker(**kwargs) def _looker_to_nested_bytes(looker: Looker, serde: Serde) -> bytes: @@ -622,10 +625,7 @@ def _looker_from_nested_bytes(data: bytes, serde: Serde) -> Looker: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Looker.LOOKER_SLUG = KeywordField("lookerSlug", "lookerSlug") Looker.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") diff --git a/pyatlan_v9/model/assets/looker_dashboard.py b/pyatlan_v9/model/assets/looker_dashboard.py index 0b69f3de2..99566ecfe 100644 --- a/pyatlan_v9/model/assets/looker_dashboard.py +++ b/pyatlan_v9/model/assets/looker_dashboard.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,13 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .looker_related import ( + RelatedLookerDashboard, + RelatedLookerField, + RelatedLookerFolder, + RelatedLookerLook, + RelatedLookerTile, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,20 +61,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .looker_related import ( - RelatedLookerDashboard, - RelatedLookerField, - RelatedLookerFolder, - RelatedLookerLook, - RelatedLookerTile, -) # ============================================================================= # FLAT ASSET CLASS @@ -709,33 +709,36 @@ def _looker_dashboard_from_nested(nested: LookerDashboardNested) -> LookerDashbo _LOOKER_DASHBOARD_REL_FIELDS, LookerDashboardRelationshipAttributes, ) - return LookerDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return LookerDashboard(**kwargs) def _looker_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/looker_explore.py b/pyatlan_v9/model/assets/looker_explore.py index 74540a502..177303172 100644 --- a/pyatlan_v9/model/assets/looker_explore.py +++ b/pyatlan_v9/model/assets/looker_explore.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,12 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .looker_related import ( + RelatedLookerExplore, + RelatedLookerField, + RelatedLookerModel, + RelatedLookerProject, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,19 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .looker_related import ( - RelatedLookerExplore, - RelatedLookerField, - RelatedLookerModel, - RelatedLookerProject, -) # ============================================================================= # FLAT ASSET CLASS @@ -682,33 +682,36 @@ def _looker_explore_from_nested(nested: LookerExploreNested) -> LookerExplore: _LOOKER_EXPLORE_REL_FIELDS, LookerExploreRelationshipAttributes, ) - return LookerExplore( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_explore_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_explore_attrs(attrs)) + kwargs.update(merged_rels) + return LookerExplore(**kwargs) def _looker_explore_to_nested_bytes( @@ -727,10 +730,7 @@ def _looker_explore_from_nested_bytes(data: bytes, serde: Serde) -> LookerExplor # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 LookerExplore.PROJECT_NAME = KeywordField("projectName", "projectName") LookerExplore.MODEL_NAME = KeywordField("modelName", "modelName") diff --git a/pyatlan_v9/model/assets/looker_field.py b/pyatlan_v9/model/assets/looker_field.py index 9983bcb35..e0a64a903 100644 --- a/pyatlan_v9/model/assets/looker_field.py +++ b/pyatlan_v9/model/assets/looker_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,22 +45,6 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile -from .model_related import RelatedModelAttribute, RelatedModelEntity -from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor -from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .looker_related import ( RelatedLookerDashboard, RelatedLookerExplore, @@ -64,6 +55,15 @@ RelatedLookerTile, RelatedLookerView, ) +from .model_related import RelatedModelAttribute, RelatedModelEntity +from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .partial_related import RelatedPartialField, RelatedPartialObject +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -788,33 +788,36 @@ def _looker_field_from_nested(nested: LookerFieldNested) -> LookerField: _LOOKER_FIELD_REL_FIELDS, LookerFieldRelationshipAttributes, ) - return LookerField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_field_attrs(attrs)) + kwargs.update(merged_rels) + return LookerField(**kwargs) def _looker_field_to_nested_bytes(looker_field: LookerField, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/looker_folder.py b/pyatlan_v9/model/assets/looker_folder.py index 4e8df3753..566947cc1 100644 --- a/pyatlan_v9/model/assets/looker_folder.py +++ b/pyatlan_v9/model/assets/looker_folder.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .looker_related import ( + RelatedLookerDashboard, + RelatedLookerFolder, + RelatedLookerLook, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .looker_related import ( - RelatedLookerDashboard, - RelatedLookerFolder, - RelatedLookerLook, -) # ============================================================================= # FLAT ASSET CLASS @@ -664,33 +664,36 @@ def _looker_folder_from_nested(nested: LookerFolderNested) -> LookerFolder: _LOOKER_FOLDER_REL_FIELDS, LookerFolderRelationshipAttributes, ) - return LookerFolder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_folder_attrs(attrs)) + kwargs.update(merged_rels) + return LookerFolder(**kwargs) def _looker_folder_to_nested_bytes(looker_folder: LookerFolder, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/looker_look.py b/pyatlan_v9/model/assets/looker_look.py index ce0f069ed..d8f3a99a1 100644 --- a/pyatlan_v9/model/assets/looker_look.py +++ b/pyatlan_v9/model/assets/looker_look.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,22 +45,6 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile -from .model_related import RelatedModelAttribute, RelatedModelEntity -from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor -from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .looker_related import ( RelatedLookerDashboard, RelatedLookerField, @@ -63,6 +54,15 @@ RelatedLookerQuery, RelatedLookerTile, ) +from .model_related import RelatedModelAttribute, RelatedModelEntity +from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .partial_related import RelatedPartialField, RelatedPartialObject +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -742,33 +742,36 @@ def _looker_look_from_nested(nested: LookerLookNested) -> LookerLook: _LOOKER_LOOK_REL_FIELDS, LookerLookRelationshipAttributes, ) - return LookerLook( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_look_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_look_attrs(attrs)) + kwargs.update(merged_rels) + return LookerLook(**kwargs) def _looker_look_to_nested_bytes(looker_look: LookerLook, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/looker_model.py b/pyatlan_v9/model/assets/looker_model.py index c02fc6d99..7015bf34f 100644 --- a/pyatlan_v9/model/assets/looker_model.py +++ b/pyatlan_v9/model/assets/looker_model.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,14 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .looker_related import ( + RelatedLookerExplore, + RelatedLookerField, + RelatedLookerLook, + RelatedLookerModel, + RelatedLookerProject, + RelatedLookerQuery, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,21 +62,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .looker_related import ( - RelatedLookerExplore, - RelatedLookerField, - RelatedLookerLook, - RelatedLookerModel, - RelatedLookerProject, - RelatedLookerQuery, -) # ============================================================================= # FLAT ASSET CLASS @@ -654,33 +654,36 @@ def _looker_model_from_nested(nested: LookerModelNested) -> LookerModel: _LOOKER_MODEL_REL_FIELDS, LookerModelRelationshipAttributes, ) - return LookerModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_model_attrs(attrs)) + kwargs.update(merged_rels) + return LookerModel(**kwargs) def _looker_model_to_nested_bytes(looker_model: LookerModel, serde: Serde) -> bytes: @@ -697,10 +700,7 @@ def _looker_model_from_nested_bytes(data: bytes, serde: Serde) -> LookerModel: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 LookerModel.PROJECT_NAME = KeywordField("projectName", "projectName") LookerModel.LOOKER_SLUG = KeywordField("lookerSlug", "lookerSlug") diff --git a/pyatlan_v9/model/assets/looker_project.py b/pyatlan_v9/model/assets/looker_project.py index f9f11f8ea..f0feff5ef 100644 --- a/pyatlan_v9/model/assets/looker_project.py +++ b/pyatlan_v9/model/assets/looker_project.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,13 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .looker_related import ( + RelatedLookerExplore, + RelatedLookerField, + RelatedLookerModel, + RelatedLookerProject, + RelatedLookerView, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -46,20 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .looker_related import ( - RelatedLookerExplore, - RelatedLookerField, - RelatedLookerModel, - RelatedLookerProject, - RelatedLookerView, -) # ============================================================================= # FLAT ASSET CLASS @@ -641,33 +641,36 @@ def _looker_project_from_nested(nested: LookerProjectNested) -> LookerProject: _LOOKER_PROJECT_REL_FIELDS, LookerProjectRelationshipAttributes, ) - return LookerProject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_project_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_project_attrs(attrs)) + kwargs.update(merged_rels) + return LookerProject(**kwargs) def _looker_project_to_nested_bytes( @@ -686,10 +689,7 @@ def _looker_project_from_nested_bytes(data: bytes, serde: Serde) -> LookerProjec # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 LookerProject.LOOKER_SLUG = KeywordField("lookerSlug", "lookerSlug") LookerProject.CATALOG_DATASET_GUID = KeywordField( diff --git a/pyatlan_v9/model/assets/looker_query.py b/pyatlan_v9/model/assets/looker_query.py index a55e4b690..838d1a5c3 100644 --- a/pyatlan_v9/model/assets/looker_query.py +++ b/pyatlan_v9/model/assets/looker_query.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,12 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .looker_related import ( + RelatedLookerLook, + RelatedLookerModel, + RelatedLookerQuery, + RelatedLookerTile, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,19 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .looker_related import ( - RelatedLookerLook, - RelatedLookerModel, - RelatedLookerQuery, - RelatedLookerTile, -) # ============================================================================= # FLAT ASSET CLASS @@ -663,33 +663,36 @@ def _looker_query_from_nested(nested: LookerQueryNested) -> LookerQuery: _LOOKER_QUERY_REL_FIELDS, LookerQueryRelationshipAttributes, ) - return LookerQuery( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_query_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_query_attrs(attrs)) + kwargs.update(merged_rels) + return LookerQuery(**kwargs) def _looker_query_to_nested_bytes(looker_query: LookerQuery, serde: Serde) -> bytes: @@ -706,10 +709,7 @@ def _looker_query_from_nested_bytes(data: bytes, serde: Serde) -> LookerQuery: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 LookerQuery.SOURCE_DEFINITION = KeywordField("sourceDefinition", "sourceDefinition") LookerQuery.SOURCE_DEFINITION_DATABASE = KeywordField( diff --git a/pyatlan_v9/model/assets/looker_tile.py b/pyatlan_v9/model/assets/looker_tile.py index e87a67849..2e2be1568 100644 --- a/pyatlan_v9/model/assets/looker_tile.py +++ b/pyatlan_v9/model/assets/looker_tile.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -39,6 +46,13 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .looker_related import ( + RelatedLookerDashboard, + RelatedLookerField, + RelatedLookerLook, + RelatedLookerQuery, + RelatedLookerTile, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -48,20 +62,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .looker_related import ( - RelatedLookerDashboard, - RelatedLookerField, - RelatedLookerLook, - RelatedLookerQuery, - RelatedLookerTile, -) # ============================================================================= # FLAT ASSET CLASS @@ -715,33 +715,36 @@ def _looker_tile_from_nested(nested: LookerTileNested) -> LookerTile: _LOOKER_TILE_REL_FIELDS, LookerTileRelationshipAttributes, ) - return LookerTile( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_tile_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_tile_attrs(attrs)) + kwargs.update(merged_rels) + return LookerTile(**kwargs) def _looker_tile_to_nested_bytes(looker_tile: LookerTile, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/looker_view.py b/pyatlan_v9/model/assets/looker_view.py index 43e9d65e4..9594ef4aa 100644 --- a/pyatlan_v9/model/assets/looker_view.py +++ b/pyatlan_v9/model/assets/looker_view.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .looker_related import RelatedLookerField, RelatedLookerProject, RelatedLookerView from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .looker_related import RelatedLookerField, RelatedLookerProject, RelatedLookerView # ============================================================================= # FLAT ASSET CLASS @@ -639,33 +639,36 @@ def _looker_view_from_nested(nested: LookerViewNested) -> LookerView: _LOOKER_VIEW_REL_FIELDS, LookerViewRelationshipAttributes, ) - return LookerView( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_looker_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_looker_view_attrs(attrs)) + kwargs.update(merged_rels) + return LookerView(**kwargs) def _looker_view_to_nested_bytes(looker_view: LookerView, serde: Serde) -> bytes: @@ -682,10 +685,7 @@ def _looker_view_from_nested_bytes(data: bytes, serde: Serde) -> LookerView: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 LookerView.PROJECT_NAME = KeywordField("projectName", "projectName") LookerView.LOOKER_VIEW_FILE_PATH = KeywordField( diff --git a/pyatlan_v9/model/assets/materialised_view.py b/pyatlan_v9/model/assets/materialised_view.py index 0cac57689..3a1babf17 100644 --- a/pyatlan_v9/model/assets/materialised_view.py +++ b/pyatlan_v9/model/assets/materialised_view.py @@ -20,6 +20,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -59,14 +67,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .sql_related import RelatedColumn, RelatedMaterialisedView, RelatedSchema # ============================================================================= @@ -1257,33 +1257,36 @@ def _materialised_view_from_nested(nested: MaterialisedViewNested) -> Materialis _MATERIALISED_VIEW_REL_FIELDS, MaterialisedViewRelationshipAttributes, ) - return MaterialisedView( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_materialised_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_materialised_view_attrs(attrs)) + kwargs.update(merged_rels) + return MaterialisedView(**kwargs) def _materialised_view_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/matillion.py b/pyatlan_v9/model/assets/matillion.py index 1088794cc..f6b11a596 100644 --- a/pyatlan_v9/model/assets/matillion.py +++ b/pyatlan_v9/model/assets/matillion.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .matillion_related import RelatedMatillion from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .matillion_related import RelatedMatillion # ============================================================================= # FLAT ASSET CLASS @@ -581,33 +581,36 @@ def _matillion_from_nested(nested: MatillionNested) -> Matillion: _MATILLION_REL_FIELDS, MatillionRelationshipAttributes, ) - return Matillion( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_matillion_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_matillion_attrs(attrs)) + kwargs.update(merged_rels) + return Matillion(**kwargs) def _matillion_to_nested_bytes(matillion: Matillion, serde: Serde) -> bytes: @@ -624,10 +627,7 @@ def _matillion_from_nested_bytes(data: bytes, serde: Serde) -> Matillion: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Matillion.MATILLION_VERSION = KeywordField("matillionVersion", "matillionVersion") Matillion.CATALOG_DATASET_GUID = KeywordField( diff --git a/pyatlan_v9/model/assets/matillion_component.py b/pyatlan_v9/model/assets/matillion_component.py index 3f6591ed5..1888b4dba 100644 --- a/pyatlan_v9/model/assets/matillion_component.py +++ b/pyatlan_v9/model/assets/matillion_component.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .matillion_related import RelatedMatillionComponent, RelatedMatillionJob from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .matillion_related import RelatedMatillionComponent, RelatedMatillionJob # ============================================================================= # FLAT ASSET CLASS @@ -712,33 +712,36 @@ def _matillion_component_from_nested( _MATILLION_COMPONENT_REL_FIELDS, MatillionComponentRelationshipAttributes, ) - return MatillionComponent( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_matillion_component_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_matillion_component_attrs(attrs)) + kwargs.update(merged_rels) + return MatillionComponent(**kwargs) def _matillion_component_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/matillion_group.py b/pyatlan_v9/model/assets/matillion_group.py index 78d9c035f..90bd4052d 100644 --- a/pyatlan_v9/model/assets/matillion_group.py +++ b/pyatlan_v9/model/assets/matillion_group.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .matillion_related import RelatedMatillionGroup, RelatedMatillionProject from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .matillion_related import RelatedMatillionGroup, RelatedMatillionProject # ============================================================================= # FLAT ASSET CLASS @@ -606,33 +606,36 @@ def _matillion_group_from_nested(nested: MatillionGroupNested) -> MatillionGroup _MATILLION_GROUP_REL_FIELDS, MatillionGroupRelationshipAttributes, ) - return MatillionGroup( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_matillion_group_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_matillion_group_attrs(attrs)) + kwargs.update(merged_rels) + return MatillionGroup(**kwargs) def _matillion_group_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/matillion_job.py b/pyatlan_v9/model/assets/matillion_job.py index afbef72a8..dd6a3006d 100644 --- a/pyatlan_v9/model/assets/matillion_job.py +++ b/pyatlan_v9/model/assets/matillion_job.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .matillion_related import ( + RelatedMatillionComponent, + RelatedMatillionJob, + RelatedMatillionProject, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .matillion_related import ( - RelatedMatillionComponent, - RelatedMatillionJob, - RelatedMatillionProject, -) # ============================================================================= # FLAT ASSET CLASS @@ -686,33 +686,36 @@ def _matillion_job_from_nested(nested: MatillionJobNested) -> MatillionJob: _MATILLION_JOB_REL_FIELDS, MatillionJobRelationshipAttributes, ) - return MatillionJob( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_matillion_job_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_matillion_job_attrs(attrs)) + kwargs.update(merged_rels) + return MatillionJob(**kwargs) def _matillion_job_to_nested_bytes(matillion_job: MatillionJob, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/matillion_project.py b/pyatlan_v9/model/assets/matillion_project.py index 4650ae731..2549148f0 100644 --- a/pyatlan_v9/model/assets/matillion_project.py +++ b/pyatlan_v9/model/assets/matillion_project.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .matillion_related import ( + RelatedMatillionGroup, + RelatedMatillionJob, + RelatedMatillionProject, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .matillion_related import ( - RelatedMatillionGroup, - RelatedMatillionJob, - RelatedMatillionProject, -) # ============================================================================= # FLAT ASSET CLASS @@ -675,33 +675,36 @@ def _matillion_project_from_nested(nested: MatillionProjectNested) -> MatillionP _MATILLION_PROJECT_REL_FIELDS, MatillionProjectRelationshipAttributes, ) - return MatillionProject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_matillion_project_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_matillion_project_attrs(attrs)) + kwargs.update(merged_rels) + return MatillionProject(**kwargs) def _matillion_project_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/mc_incident.py b/pyatlan_v9/model/assets/mc_incident.py index 71c848a1b..f4e0afd21 100644 --- a/pyatlan_v9/model/assets/mc_incident.py +++ b/pyatlan_v9/model/assets/mc_incident.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -40,6 +47,7 @@ from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity +from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor # ============================================================================= # FLAT ASSET CLASS @@ -691,33 +691,36 @@ def _mc_incident_from_nested(nested: MCIncidentNested) -> MCIncident: _MC_INCIDENT_REL_FIELDS, MCIncidentRelationshipAttributes, ) - return MCIncident( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mc_incident_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mc_incident_attrs(attrs)) + kwargs.update(merged_rels) + return MCIncident(**kwargs) def _mc_incident_to_nested_bytes(mc_incident: MCIncident, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/mc_monitor.py b/pyatlan_v9/model/assets/mc_monitor.py index 3c847f6b4..7b4fe7b48 100644 --- a/pyatlan_v9/model/assets/mc_monitor.py +++ b/pyatlan_v9/model/assets/mc_monitor.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -39,6 +46,7 @@ from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity +from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor # ============================================================================= # FLAT ASSET CLASS @@ -806,33 +806,36 @@ def _mc_monitor_from_nested(nested: MCMonitorNested) -> MCMonitor: _MC_MONITOR_REL_FIELDS, MCMonitorRelationshipAttributes, ) - return MCMonitor( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mc_monitor_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mc_monitor_attrs(attrs)) + kwargs.update(merged_rels) + return MCMonitor(**kwargs) def _mc_monitor_to_nested_bytes(mc_monitor: MCMonitor, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/metabase.py b/pyatlan_v9/model/assets/metabase.py index 0dbdd9e55..03e450622 100644 --- a/pyatlan_v9/model/assets/metabase.py +++ b/pyatlan_v9/model/assets/metabase.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .metabase_related import RelatedMetabase from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .metabase_related import RelatedMetabase # ============================================================================= # FLAT ASSET CLASS @@ -592,33 +592,36 @@ def _metabase_from_nested(nested: MetabaseNested) -> Metabase: _METABASE_REL_FIELDS, MetabaseRelationshipAttributes, ) - return Metabase( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_metabase_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_metabase_attrs(attrs)) + kwargs.update(merged_rels) + return Metabase(**kwargs) def _metabase_to_nested_bytes(metabase: Metabase, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/metabase_collection.py b/pyatlan_v9/model/assets/metabase_collection.py index 10a9e502f..54edd4c1a 100644 --- a/pyatlan_v9/model/assets/metabase_collection.py +++ b/pyatlan_v9/model/assets/metabase_collection.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +45,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .metabase_related import ( + RelatedMetabaseCollection, + RelatedMetabaseDashboard, + RelatedMetabaseQuestion, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -46,19 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .metabase_related import ( - RelatedMetabaseCollection, - RelatedMetabaseDashboard, - RelatedMetabaseQuestion, -) # ============================================================================= # FLAT ASSET CLASS @@ -693,33 +693,36 @@ def _metabase_collection_from_nested( _METABASE_COLLECTION_REL_FIELDS, MetabaseCollectionRelationshipAttributes, ) - return MetabaseCollection( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_metabase_collection_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_metabase_collection_attrs(attrs)) + kwargs.update(merged_rels) + return MetabaseCollection(**kwargs) def _metabase_collection_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/metabase_dashboard.py b/pyatlan_v9/model/assets/metabase_dashboard.py index e5eb4a528..bcd2eec54 100644 --- a/pyatlan_v9/model/assets/metabase_dashboard.py +++ b/pyatlan_v9/model/assets/metabase_dashboard.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +46,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .metabase_related import ( + RelatedMetabaseCollection, + RelatedMetabaseDashboard, + RelatedMetabaseQuestion, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,19 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .metabase_related import ( - RelatedMetabaseCollection, - RelatedMetabaseDashboard, - RelatedMetabaseQuestion, -) # ============================================================================= # FLAT ASSET CLASS @@ -685,33 +685,36 @@ def _metabase_dashboard_from_nested( _METABASE_DASHBOARD_REL_FIELDS, MetabaseDashboardRelationshipAttributes, ) - return MetabaseDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_metabase_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_metabase_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return MetabaseDashboard(**kwargs) def _metabase_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/metabase_question.py b/pyatlan_v9/model/assets/metabase_question.py index 209964307..234b1a161 100644 --- a/pyatlan_v9/model/assets/metabase_question.py +++ b/pyatlan_v9/model/assets/metabase_question.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +46,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .metabase_related import ( + RelatedMetabaseCollection, + RelatedMetabaseDashboard, + RelatedMetabaseQuestion, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,19 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .metabase_related import ( - RelatedMetabaseCollection, - RelatedMetabaseDashboard, - RelatedMetabaseQuestion, -) # ============================================================================= # FLAT ASSET CLASS @@ -701,33 +701,36 @@ def _metabase_question_from_nested(nested: MetabaseQuestionNested) -> MetabaseQu _METABASE_QUESTION_REL_FIELDS, MetabaseQuestionRelationshipAttributes, ) - return MetabaseQuestion( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_metabase_question_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_metabase_question_attrs(attrs)) + kwargs.update(merged_rels) + return MetabaseQuestion(**kwargs) def _metabase_question_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/metric.py b/pyatlan_v9/model/assets/metric.py index c7295b058..58740c3d6 100644 --- a/pyatlan_v9/model/assets/metric.py +++ b/pyatlan_v9/model/assets/metric.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -35,6 +42,7 @@ from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct +from .data_quality_related import RelatedDataQualityRule, RelatedMetric from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile @@ -48,14 +56,6 @@ from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedColumn -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .data_quality_related import RelatedDataQualityRule, RelatedMetric # ============================================================================= # FLAT ASSET CLASS @@ -645,33 +645,36 @@ def _metric_from_nested(nested: MetricNested) -> Metric: _METRIC_REL_FIELDS, MetricRelationshipAttributes, ) - return Metric( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_metric_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_metric_attrs(attrs)) + kwargs.update(merged_rels) + return Metric(**kwargs) def _metric_to_nested_bytes(metric: Metric, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/micro_strategy.py b/pyatlan_v9/model/assets/micro_strategy.py index b1ec1db41..7ee537357 100644 --- a/pyatlan_v9/model/assets/micro_strategy.py +++ b/pyatlan_v9/model/assets/micro_strategy.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .micro_strategy_related import RelatedMicroStrategy from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .micro_strategy_related import RelatedMicroStrategy # ============================================================================= # FLAT ASSET CLASS @@ -678,33 +678,36 @@ def _micro_strategy_from_nested(nested: MicroStrategyNested) -> MicroStrategy: _MICRO_STRATEGY_REL_FIELDS, MicroStrategyRelationshipAttributes, ) - return MicroStrategy( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategy(**kwargs) def _micro_strategy_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/micro_strategy_attribute.py b/pyatlan_v9/model/assets/micro_strategy_attribute.py index a4ef1378f..1d1edb06b 100644 --- a/pyatlan_v9/model/assets/micro_strategy_attribute.py +++ b/pyatlan_v9/model/assets/micro_strategy_attribute.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,14 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .micro_strategy_related import ( + RelatedMicroStrategyAttribute, + RelatedMicroStrategyColumn, + RelatedMicroStrategyCube, + RelatedMicroStrategyMetric, + RelatedMicroStrategyProject, + RelatedMicroStrategyReport, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,21 +62,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .micro_strategy_related import ( - RelatedMicroStrategyAttribute, - RelatedMicroStrategyColumn, - RelatedMicroStrategyCube, - RelatedMicroStrategyMetric, - RelatedMicroStrategyProject, - RelatedMicroStrategyReport, -) # ============================================================================= # FLAT ASSET CLASS @@ -777,33 +777,36 @@ def _micro_strategy_attribute_from_nested( _MICRO_STRATEGY_ATTRIBUTE_REL_FIELDS, MicroStrategyAttributeRelationshipAttributes, ) - return MicroStrategyAttribute( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_attribute_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_attribute_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategyAttribute(**kwargs) def _micro_strategy_attribute_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/micro_strategy_column.py b/pyatlan_v9/model/assets/micro_strategy_column.py index b114818e9..69e99fae6 100644 --- a/pyatlan_v9/model/assets/micro_strategy_column.py +++ b/pyatlan_v9/model/assets/micro_strategy_column.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,22 +45,6 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile -from .model_related import RelatedModelAttribute, RelatedModelEntity -from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor -from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .micro_strategy_related import ( RelatedMicroStrategyAttribute, RelatedMicroStrategyColumn, @@ -64,6 +55,15 @@ RelatedMicroStrategyMetric, RelatedMicroStrategyReport, ) +from .model_related import RelatedModelAttribute, RelatedModelEntity +from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .partial_related import RelatedPartialField, RelatedPartialObject +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -916,33 +916,36 @@ def _micro_strategy_column_from_nested( _MICRO_STRATEGY_COLUMN_REL_FIELDS, MicroStrategyColumnRelationshipAttributes, ) - return MicroStrategyColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_column_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategyColumn(**kwargs) def _micro_strategy_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/micro_strategy_cube.py b/pyatlan_v9/model/assets/micro_strategy_cube.py index a70f5178a..792b2180c 100644 --- a/pyatlan_v9/model/assets/micro_strategy_cube.py +++ b/pyatlan_v9/model/assets/micro_strategy_cube.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,13 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .micro_strategy_related import ( + RelatedMicroStrategyAttribute, + RelatedMicroStrategyColumn, + RelatedMicroStrategyCube, + RelatedMicroStrategyMetric, + RelatedMicroStrategyProject, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,20 +61,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .micro_strategy_related import ( - RelatedMicroStrategyAttribute, - RelatedMicroStrategyColumn, - RelatedMicroStrategyCube, - RelatedMicroStrategyMetric, - RelatedMicroStrategyProject, -) # ============================================================================= # FLAT ASSET CLASS @@ -773,33 +773,36 @@ def _micro_strategy_cube_from_nested( _MICRO_STRATEGY_CUBE_REL_FIELDS, MicroStrategyCubeRelationshipAttributes, ) - return MicroStrategyCube( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_cube_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_cube_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategyCube(**kwargs) def _micro_strategy_cube_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/micro_strategy_document.py b/pyatlan_v9/model/assets/micro_strategy_document.py index 7185410b2..dc2e83260 100644 --- a/pyatlan_v9/model/assets/micro_strategy_document.py +++ b/pyatlan_v9/model/assets/micro_strategy_document.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .micro_strategy_related import ( + RelatedMicroStrategyColumn, + RelatedMicroStrategyDocument, + RelatedMicroStrategyProject, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .micro_strategy_related import ( - RelatedMicroStrategyColumn, - RelatedMicroStrategyDocument, - RelatedMicroStrategyProject, -) # ============================================================================= # FLAT ASSET CLASS @@ -731,33 +731,36 @@ def _micro_strategy_document_from_nested( _MICRO_STRATEGY_DOCUMENT_REL_FIELDS, MicroStrategyDocumentRelationshipAttributes, ) - return MicroStrategyDocument( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_document_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_document_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategyDocument(**kwargs) def _micro_strategy_document_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/micro_strategy_dossier.py b/pyatlan_v9/model/assets/micro_strategy_dossier.py index f55ae2aa7..ec5f68fb2 100644 --- a/pyatlan_v9/model/assets/micro_strategy_dossier.py +++ b/pyatlan_v9/model/assets/micro_strategy_dossier.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,12 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .micro_strategy_related import ( + RelatedMicroStrategyColumn, + RelatedMicroStrategyDossier, + RelatedMicroStrategyProject, + RelatedMicroStrategyVisualization, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,19 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .micro_strategy_related import ( - RelatedMicroStrategyColumn, - RelatedMicroStrategyDossier, - RelatedMicroStrategyProject, - RelatedMicroStrategyVisualization, -) # ============================================================================= # FLAT ASSET CLASS @@ -757,33 +757,36 @@ def _micro_strategy_dossier_from_nested( _MICRO_STRATEGY_DOSSIER_REL_FIELDS, MicroStrategyDossierRelationshipAttributes, ) - return MicroStrategyDossier( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_dossier_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_dossier_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategyDossier(**kwargs) def _micro_strategy_dossier_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/micro_strategy_fact.py b/pyatlan_v9/model/assets/micro_strategy_fact.py index b022f0a0c..b2b770938 100644 --- a/pyatlan_v9/model/assets/micro_strategy_fact.py +++ b/pyatlan_v9/model/assets/micro_strategy_fact.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,12 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .micro_strategy_related import ( + RelatedMicroStrategyColumn, + RelatedMicroStrategyFact, + RelatedMicroStrategyMetric, + RelatedMicroStrategyProject, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,19 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .micro_strategy_related import ( - RelatedMicroStrategyColumn, - RelatedMicroStrategyFact, - RelatedMicroStrategyMetric, - RelatedMicroStrategyProject, -) # ============================================================================= # FLAT ASSET CLASS @@ -751,33 +751,36 @@ def _micro_strategy_fact_from_nested( _MICRO_STRATEGY_FACT_REL_FIELDS, MicroStrategyFactRelationshipAttributes, ) - return MicroStrategyFact( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_fact_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_fact_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategyFact(**kwargs) def _micro_strategy_fact_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/micro_strategy_metric.py b/pyatlan_v9/model/assets/micro_strategy_metric.py index 6ab7b99c8..35e81efd7 100644 --- a/pyatlan_v9/model/assets/micro_strategy_metric.py +++ b/pyatlan_v9/model/assets/micro_strategy_metric.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,22 +45,6 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile -from .model_related import RelatedModelAttribute, RelatedModelEntity -from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor -from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .micro_strategy_related import ( RelatedMicroStrategyAttribute, RelatedMicroStrategyColumn, @@ -63,6 +54,15 @@ RelatedMicroStrategyProject, RelatedMicroStrategyReport, ) +from .model_related import RelatedModelAttribute, RelatedModelEntity +from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .partial_related import RelatedPartialField, RelatedPartialObject +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -876,33 +876,36 @@ def _micro_strategy_metric_from_nested( _MICRO_STRATEGY_METRIC_REL_FIELDS, MicroStrategyMetricRelationshipAttributes, ) - return MicroStrategyMetric( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_metric_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_metric_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategyMetric(**kwargs) def _micro_strategy_metric_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/micro_strategy_project.py b/pyatlan_v9/model/assets/micro_strategy_project.py index 2ff276846..3defcf61d 100644 --- a/pyatlan_v9/model/assets/micro_strategy_project.py +++ b/pyatlan_v9/model/assets/micro_strategy_project.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,22 +44,6 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile -from .model_related import RelatedModelAttribute, RelatedModelEntity -from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor -from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .micro_strategy_related import ( RelatedMicroStrategyAttribute, RelatedMicroStrategyCube, @@ -64,6 +55,15 @@ RelatedMicroStrategyReport, RelatedMicroStrategyVisualization, ) +from .model_related import RelatedModelAttribute, RelatedModelEntity +from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .partial_related import RelatedPartialField, RelatedPartialObject +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -786,33 +786,36 @@ def _micro_strategy_project_from_nested( _MICRO_STRATEGY_PROJECT_REL_FIELDS, MicroStrategyProjectRelationshipAttributes, ) - return MicroStrategyProject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_project_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_project_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategyProject(**kwargs) def _micro_strategy_project_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/micro_strategy_report.py b/pyatlan_v9/model/assets/micro_strategy_report.py index d5277027a..f9ff7e297 100644 --- a/pyatlan_v9/model/assets/micro_strategy_report.py +++ b/pyatlan_v9/model/assets/micro_strategy_report.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,13 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .micro_strategy_related import ( + RelatedMicroStrategyAttribute, + RelatedMicroStrategyColumn, + RelatedMicroStrategyMetric, + RelatedMicroStrategyProject, + RelatedMicroStrategyReport, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,20 +61,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .micro_strategy_related import ( - RelatedMicroStrategyAttribute, - RelatedMicroStrategyColumn, - RelatedMicroStrategyMetric, - RelatedMicroStrategyProject, - RelatedMicroStrategyReport, -) # ============================================================================= # FLAT ASSET CLASS @@ -764,33 +764,36 @@ def _micro_strategy_report_from_nested( _MICRO_STRATEGY_REPORT_REL_FIELDS, MicroStrategyReportRelationshipAttributes, ) - return MicroStrategyReport( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_report_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_report_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategyReport(**kwargs) def _micro_strategy_report_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/micro_strategy_visualization.py b/pyatlan_v9/model/assets/micro_strategy_visualization.py index 9554855f0..11c6a4133 100644 --- a/pyatlan_v9/model/assets/micro_strategy_visualization.py +++ b/pyatlan_v9/model/assets/micro_strategy_visualization.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .micro_strategy_related import ( + RelatedMicroStrategyDossier, + RelatedMicroStrategyProject, + RelatedMicroStrategyVisualization, +) from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,18 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .micro_strategy_related import ( - RelatedMicroStrategyDossier, - RelatedMicroStrategyProject, - RelatedMicroStrategyVisualization, -) # ============================================================================= # FLAT ASSET CLASS @@ -762,33 +762,36 @@ def _micro_strategy_visualization_from_nested( _MICRO_STRATEGY_VISUALIZATION_REL_FIELDS, MicroStrategyVisualizationRelationshipAttributes, ) - return MicroStrategyVisualization( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_micro_strategy_visualization_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_micro_strategy_visualization_attrs(attrs)) + kwargs.update(merged_rels) + return MicroStrategyVisualization(**kwargs) def _micro_strategy_visualization_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/mode.py b/pyatlan_v9/model/assets/mode.py index 6ed732af6..789d3a7e2 100644 --- a/pyatlan_v9/model/assets/mode.py +++ b/pyatlan_v9/model/assets/mode.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .mode_related import RelatedMode from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .mode_related import RelatedMode # ============================================================================= # FLAT ASSET CLASS @@ -647,33 +647,36 @@ def _mode_from_nested(nested: ModeNested) -> Mode: _MODE_REL_FIELDS, ModeRelationshipAttributes, ) - return Mode( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mode_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mode_attrs(attrs)) + kwargs.update(merged_rels) + return Mode(**kwargs) def _mode_to_nested_bytes(mode: Mode, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/mode_chart.py b/pyatlan_v9/model/assets/mode_chart.py index 876fe123b..d0c5c2b02 100644 --- a/pyatlan_v9/model/assets/mode_chart.py +++ b/pyatlan_v9/model/assets/mode_chart.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .mode_related import RelatedModeChart, RelatedModeQuery from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .mode_related import RelatedModeChart, RelatedModeQuery # ============================================================================= # FLAT ASSET CLASS @@ -697,33 +697,36 @@ def _mode_chart_from_nested(nested: ModeChartNested) -> ModeChart: _MODE_CHART_REL_FIELDS, ModeChartRelationshipAttributes, ) - return ModeChart( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mode_chart_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mode_chart_attrs(attrs)) + kwargs.update(merged_rels) + return ModeChart(**kwargs) def _mode_chart_to_nested_bytes(mode_chart: ModeChart, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/mode_collection.py b/pyatlan_v9/model/assets/mode_collection.py index cfc34d039..0fe1639b0 100644 --- a/pyatlan_v9/model/assets/mode_collection.py +++ b/pyatlan_v9/model/assets/mode_collection.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .mode_related import RelatedModeCollection, RelatedModeReport, RelatedModeWorkspace from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .mode_related import RelatedModeCollection, RelatedModeReport, RelatedModeWorkspace # ============================================================================= # FLAT ASSET CLASS @@ -712,33 +712,36 @@ def _mode_collection_from_nested(nested: ModeCollectionNested) -> ModeCollection _MODE_COLLECTION_REL_FIELDS, ModeCollectionRelationshipAttributes, ) - return ModeCollection( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mode_collection_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mode_collection_attrs(attrs)) + kwargs.update(merged_rels) + return ModeCollection(**kwargs) def _mode_collection_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/mode_query.py b/pyatlan_v9/model/assets/mode_query.py index ac21c73b1..9907f895a 100644 --- a/pyatlan_v9/model/assets/mode_query.py +++ b/pyatlan_v9/model/assets/mode_query.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .mode_related import RelatedModeChart, RelatedModeQuery, RelatedModeReport from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .mode_related import RelatedModeChart, RelatedModeQuery, RelatedModeReport # ============================================================================= # FLAT ASSET CLASS @@ -710,33 +710,36 @@ def _mode_query_from_nested(nested: ModeQueryNested) -> ModeQuery: _MODE_QUERY_REL_FIELDS, ModeQueryRelationshipAttributes, ) - return ModeQuery( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mode_query_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mode_query_attrs(attrs)) + kwargs.update(merged_rels) + return ModeQuery(**kwargs) def _mode_query_to_nested_bytes(mode_query: ModeQuery, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/mode_report.py b/pyatlan_v9/model/assets/mode_report.py index b9dfc7ebd..a1a750d76 100644 --- a/pyatlan_v9/model/assets/mode_report.py +++ b/pyatlan_v9/model/assets/mode_report.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .mode_related import RelatedModeCollection, RelatedModeQuery, RelatedModeReport from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .mode_related import RelatedModeCollection, RelatedModeQuery, RelatedModeReport # ============================================================================= # FLAT ASSET CLASS @@ -760,33 +760,36 @@ def _mode_report_from_nested(nested: ModeReportNested) -> ModeReport: _MODE_REPORT_REL_FIELDS, ModeReportRelationshipAttributes, ) - return ModeReport( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mode_report_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mode_report_attrs(attrs)) + kwargs.update(merged_rels) + return ModeReport(**kwargs) def _mode_report_to_nested_bytes(mode_report: ModeReport, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/mode_workspace.py b/pyatlan_v9/model/assets/mode_workspace.py index 79edf2076..4274ae1e2 100644 --- a/pyatlan_v9/model/assets/mode_workspace.py +++ b/pyatlan_v9/model/assets/mode_workspace.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .mode_related import RelatedModeCollection, RelatedModeWorkspace from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .mode_related import RelatedModeCollection, RelatedModeWorkspace # ============================================================================= # FLAT ASSET CLASS @@ -676,33 +676,36 @@ def _mode_workspace_from_nested(nested: ModeWorkspaceNested) -> ModeWorkspace: _MODE_WORKSPACE_REL_FIELDS, ModeWorkspaceRelationshipAttributes, ) - return ModeWorkspace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mode_workspace_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mode_workspace_attrs(attrs)) + kwargs.update(merged_rels) + return ModeWorkspace(**kwargs) def _mode_workspace_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/model.py b/pyatlan_v9/model/assets/model.py index 5b7a557e7..225c92d20 100644 --- a/pyatlan_v9/model/assets/model.py +++ b/pyatlan_v9/model/assets/model.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,7 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .model_related import RelatedModel, RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess @@ -45,14 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .model_related import RelatedModel, RelatedModelAttribute, RelatedModelEntity # ============================================================================= # FLAT ASSET CLASS @@ -699,33 +699,36 @@ def _model_from_nested(nested: ModelNested) -> Model: _MODEL_REL_FIELDS, ModelRelationshipAttributes, ) - return Model( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_model_attrs(attrs)) + kwargs.update(merged_rels) + return Model(**kwargs) def _model_to_nested_bytes(model: Model, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/model_attribute.py b/pyatlan_v9/model/assets/model_attribute.py index 529a5537b..2569176e6 100644 --- a/pyatlan_v9/model/assets/model_attribute.py +++ b/pyatlan_v9/model/assets/model_attribute.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .model_related import ( + RelatedModelAttribute, + RelatedModelAttributeAssociation, + RelatedModelEntity, +) from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess @@ -46,18 +58,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .model_related import ( - RelatedModelAttribute, - RelatedModelAttributeAssociation, - RelatedModelEntity, -) # ============================================================================= # FLAT ASSET CLASS @@ -859,33 +859,36 @@ def _model_attribute_from_nested(nested: ModelAttributeNested) -> ModelAttribute _MODEL_ATTRIBUTE_REL_FIELDS, ModelAttributeRelationshipAttributes, ) - return ModelAttribute( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_model_attribute_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_model_attribute_attrs(attrs)) + kwargs.update(merged_rels) + return ModelAttribute(**kwargs) def _model_attribute_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/model_attribute_association.py b/pyatlan_v9/model/assets/model_attribute_association.py index d2c04969a..97f68fa54 100644 --- a/pyatlan_v9/model/assets/model_attribute_association.py +++ b/pyatlan_v9/model/assets/model_attribute_association.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .model_related import ( + RelatedModelAttribute, + RelatedModelAttributeAssociation, + RelatedModelEntity, +) from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess @@ -46,18 +58,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .model_related import ( - RelatedModelAttribute, - RelatedModelAttributeAssociation, - RelatedModelEntity, -) # ============================================================================= # FLAT ASSET CLASS @@ -799,33 +799,36 @@ def _model_attribute_association_from_nested( _MODEL_ATTRIBUTE_ASSOCIATION_REL_FIELDS, ModelAttributeAssociationRelationshipAttributes, ) - return ModelAttributeAssociation( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_model_attribute_association_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_model_attribute_association_attrs(attrs)) + kwargs.update(merged_rels) + return ModelAttributeAssociation(**kwargs) def _model_attribute_association_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/model_data_model.py b/pyatlan_v9/model/assets/model_data_model.py index e566731ae..5fc0c3173 100644 --- a/pyatlan_v9/model/assets/model_data_model.py +++ b/pyatlan_v9/model/assets/model_data_model.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -37,6 +44,12 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .model_related import ( + RelatedModelAttribute, + RelatedModelDataModel, + RelatedModelEntity, + RelatedModelVersion, +) from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess @@ -45,19 +58,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .model_related import ( - RelatedModelAttribute, - RelatedModelDataModel, - RelatedModelEntity, - RelatedModelVersion, -) # ============================================================================= # FLAT ASSET CLASS @@ -742,33 +742,36 @@ def _model_data_model_from_nested(nested: ModelDataModelNested) -> ModelDataMode _MODEL_DATA_MODEL_REL_FIELDS, ModelDataModelRelationshipAttributes, ) - return ModelDataModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_model_data_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_model_data_model_attrs(attrs)) + kwargs.update(merged_rels) + return ModelDataModel(**kwargs) def _model_data_model_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/model_entity.py b/pyatlan_v9/model/assets/model_entity.py index d0e5fee57..0ef5ba805 100644 --- a/pyatlan_v9/model/assets/model_entity.py +++ b/pyatlan_v9/model/assets/model_entity.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -39,6 +46,12 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .model_related import ( + RelatedModelAttribute, + RelatedModelEntity, + RelatedModelEntityAssociation, + RelatedModelVersion, +) from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess @@ -47,19 +60,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .model_related import ( - RelatedModelAttribute, - RelatedModelEntity, - RelatedModelEntityAssociation, - RelatedModelVersion, -) # ============================================================================= # FLAT ASSET CLASS @@ -862,33 +862,36 @@ def _model_entity_from_nested(nested: ModelEntityNested) -> ModelEntity: _MODEL_ENTITY_REL_FIELDS, ModelEntityRelationshipAttributes, ) - return ModelEntity( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_model_entity_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_model_entity_attrs(attrs)) + kwargs.update(merged_rels) + return ModelEntity(**kwargs) def _model_entity_to_nested_bytes(model_entity: ModelEntity, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/model_entity_association.py b/pyatlan_v9/model/assets/model_entity_association.py index bda0350cc..b14eeb5b2 100644 --- a/pyatlan_v9/model/assets/model_entity_association.py +++ b/pyatlan_v9/model/assets/model_entity_association.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,11 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .model_related import ( + RelatedModelAttribute, + RelatedModelEntity, + RelatedModelEntityAssociation, +) from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess @@ -46,18 +58,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .model_related import ( - RelatedModelAttribute, - RelatedModelEntity, - RelatedModelEntityAssociation, -) # ============================================================================= # FLAT ASSET CLASS @@ -882,33 +882,36 @@ def _model_entity_association_from_nested( _MODEL_ENTITY_ASSOCIATION_REL_FIELDS, ModelEntityAssociationRelationshipAttributes, ) - return ModelEntityAssociation( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_model_entity_association_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_model_entity_association_attrs(attrs)) + kwargs.update(merged_rels) + return ModelEntityAssociation(**kwargs) def _model_entity_association_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/model_version.py b/pyatlan_v9/model/assets/model_version.py index 5b70c6d2d..f9d70899b 100644 --- a/pyatlan_v9/model/assets/model_version.py +++ b/pyatlan_v9/model/assets/model_version.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,12 @@ from .gcp_dataplex_related import RelatedGCPDataplexAspectType from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile +from .model_related import ( + RelatedModelAttribute, + RelatedModelDataModel, + RelatedModelEntity, + RelatedModelVersion, +) from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess @@ -46,19 +59,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .model_related import ( - RelatedModelAttribute, - RelatedModelDataModel, - RelatedModelEntity, - RelatedModelVersion, -) # ============================================================================= # FLAT ASSET CLASS @@ -750,33 +750,36 @@ def _model_version_from_nested(nested: ModelVersionNested) -> ModelVersion: _MODEL_VERSION_REL_FIELDS, ModelVersionRelationshipAttributes, ) - return ModelVersion( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_model_version_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_model_version_attrs(attrs)) + kwargs.update(merged_rels) + return ModelVersion(**kwargs) def _model_version_to_nested_bytes(model_version: ModelVersion, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/mongo_db.py b/pyatlan_v9/model/assets/mongo_db.py index 39033d29b..15d6b46cf 100644 --- a/pyatlan_v9/model/assets/mongo_db.py +++ b/pyatlan_v9/model/assets/mongo_db.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -39,6 +46,7 @@ from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity +from .mongo_db_related import RelatedMongoDB from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .mongo_db_related import RelatedMongoDB # ============================================================================= # FLAT ASSET CLASS @@ -584,33 +584,36 @@ def _mongo_db_from_nested(nested: MongoDBNested) -> MongoDB: _MONGO_DB_REL_FIELDS, MongoDBRelationshipAttributes, ) - return MongoDB( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mongo_db_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mongo_db_attrs(attrs)) + kwargs.update(merged_rels) + return MongoDB(**kwargs) def _mongo_db_to_nested_bytes(mongo_db: MongoDB, serde: Serde) -> bytes: @@ -627,10 +630,7 @@ def _mongo_db_from_nested_bytes(data: bytes, serde: Serde) -> MongoDB: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 MongoDB.NO_SQL_SCHEMA_DEFINITION = KeywordField( "noSQLSchemaDefinition", "noSQLSchemaDefinition" diff --git a/pyatlan_v9/model/assets/mongo_db_collection.py b/pyatlan_v9/model/assets/mongo_db_collection.py index c31a129d5..0e48d6e13 100644 --- a/pyatlan_v9/model/assets/mongo_db_collection.py +++ b/pyatlan_v9/model/assets/mongo_db_collection.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,6 +53,7 @@ from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity +from .mongo_db_related import RelatedMongoDBCollection, RelatedMongoDBDatabase from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess @@ -66,14 +74,6 @@ RelatedTable, RelatedTablePartition, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .mongo_db_related import RelatedMongoDBCollection, RelatedMongoDBDatabase # ============================================================================= # FLAT ASSET CLASS @@ -1547,33 +1547,36 @@ def _mongo_db_collection_from_nested( _MONGO_DB_COLLECTION_REL_FIELDS, MongoDBCollectionRelationshipAttributes, ) - return MongoDBCollection( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mongo_db_collection_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mongo_db_collection_attrs(attrs)) + kwargs.update(merged_rels) + return MongoDBCollection(**kwargs) def _mongo_db_collection_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/mongo_db_database.py b/pyatlan_v9/model/assets/mongo_db_database.py index 8ed0872b9..13e4246d6 100644 --- a/pyatlan_v9/model/assets/mongo_db_database.py +++ b/pyatlan_v9/model/assets/mongo_db_database.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,6 +53,7 @@ from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity +from .mongo_db_related import RelatedMongoDBCollection, RelatedMongoDBDatabase from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess @@ -60,14 +68,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .mongo_db_related import RelatedMongoDBCollection, RelatedMongoDBDatabase # ============================================================================= # FLAT ASSET CLASS @@ -1104,33 +1104,36 @@ def _mongo_db_database_from_nested(nested: MongoDBDatabaseNested) -> MongoDBData _MONGO_DB_DATABASE_REL_FIELDS, MongoDBDatabaseRelationshipAttributes, ) - return MongoDBDatabase( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_mongo_db_database_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_mongo_db_database_attrs(attrs)) + kwargs.update(merged_rels) + return MongoDBDatabase(**kwargs) def _mongo_db_database_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/monte_carlo.py b/pyatlan_v9/model/assets/monte_carlo.py index 0aff486f5..5b42b3438 100644 --- a/pyatlan_v9/model/assets/monte_carlo.py +++ b/pyatlan_v9/model/assets/monte_carlo.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -38,6 +45,7 @@ from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity +from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor, RelatedMonteCarlo from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable @@ -45,14 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor, RelatedMonteCarlo # ============================================================================= # FLAT ASSET CLASS @@ -598,33 +598,36 @@ def _monte_carlo_from_nested(nested: MonteCarloNested) -> MonteCarlo: _MONTE_CARLO_REL_FIELDS, MonteCarloRelationshipAttributes, ) - return MonteCarlo( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_monte_carlo_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_monte_carlo_attrs(attrs)) + kwargs.update(merged_rels) + return MonteCarlo(**kwargs) def _monte_carlo_to_nested_bytes(monte_carlo: MonteCarlo, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/multi_dimensional_dataset.py b/pyatlan_v9/model/assets/multi_dimensional_dataset.py index 0994861a6..e9a7b3d6b 100644 --- a/pyatlan_v9/model/assets/multi_dimensional_dataset.py +++ b/pyatlan_v9/model/assets/multi_dimensional_dataset.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _populate_asset_attrs, ) from .context_related import RelatedContextRepository +from .cube_related import RelatedMultiDimensionalDataset from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct from .data_quality_related import RelatedDataQualityRule, RelatedMetric @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .cube_related import RelatedMultiDimensionalDataset # ============================================================================= # FLAT ASSET CLASS @@ -644,33 +644,36 @@ def _multi_dimensional_dataset_from_nested( _MULTI_DIMENSIONAL_DATASET_REL_FIELDS, MultiDimensionalDatasetRelationshipAttributes, ) - return MultiDimensionalDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_multi_dimensional_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_multi_dimensional_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return MultiDimensionalDataset(**kwargs) def _multi_dimensional_dataset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/namespace.py b/pyatlan_v9/model/assets/namespace.py index d3464a929..67c941eb0 100644 --- a/pyatlan_v9/model/assets/namespace.py +++ b/pyatlan_v9/model/assets/namespace.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -37,19 +44,12 @@ from .gtc_related import RelatedAtlasGlossaryTerm from .knowledge_related import RelatedKnowledgeFile from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .namespace_related import RelatedFolder, RelatedNamespace from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .sql_related import RelatedQuery -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .namespace_related import RelatedFolder, RelatedNamespace # ============================================================================= # FLAT ASSET CLASS @@ -492,33 +492,36 @@ def _namespace_from_nested(nested: NamespaceNested) -> Namespace: _NAMESPACE_REL_FIELDS, NamespaceRelationshipAttributes, ) - return Namespace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_namespace_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_namespace_attrs(attrs)) + kwargs.update(merged_rels) + return Namespace(**kwargs) def _namespace_to_nested_bytes(namespace: Namespace, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/no_sql.py b/pyatlan_v9/model/assets/no_sql.py index 462f415ff..bf4b76e7c 100644 --- a/pyatlan_v9/model/assets/no_sql.py +++ b/pyatlan_v9/model/assets/no_sql.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -31,6 +38,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .catalog_related import RelatedNoSQL from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .catalog_related import RelatedNoSQL # ============================================================================= # FLAT ASSET CLASS @@ -584,33 +584,36 @@ def _no_sql_from_nested(nested: NoSQLNested) -> NoSQL: _NO_SQL_REL_FIELDS, NoSQLRelationshipAttributes, ) - return NoSQL( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_no_sql_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_no_sql_attrs(attrs)) + kwargs.update(merged_rels) + return NoSQL(**kwargs) def _no_sql_to_nested_bytes(no_sql: NoSQL, serde: Serde) -> bytes: @@ -627,10 +630,7 @@ def _no_sql_from_nested_bytes(data: bytes, serde: Serde) -> NoSQL: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 NoSQL.NO_SQL_SCHEMA_DEFINITION = KeywordField( "noSQLSchemaDefinition", "noSQLSchemaDefinition" diff --git a/pyatlan_v9/model/assets/notebook.py b/pyatlan_v9/model/assets/notebook.py index e1ed22ee8..147e1770c 100644 --- a/pyatlan_v9/model/assets/notebook.py +++ b/pyatlan_v9/model/assets/notebook.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -39,6 +46,7 @@ from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .notebook_related import RelatedNotebook from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .notebook_related import RelatedNotebook # ============================================================================= # FLAT ASSET CLASS @@ -572,33 +572,36 @@ def _notebook_from_nested(nested: NotebookNested) -> Notebook: _NOTEBOOK_REL_FIELDS, NotebookRelationshipAttributes, ) - return Notebook( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_notebook_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_notebook_attrs(attrs)) + kwargs.update(merged_rels) + return Notebook(**kwargs) def _notebook_to_nested_bytes(notebook: Notebook, serde: Serde) -> bytes: @@ -615,10 +618,7 @@ def _notebook_from_nested_bytes(data: bytes, serde: Serde) -> Notebook: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Notebook.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") Notebook.INPUT_TO_AIRFLOW_TASKS = RelationField("inputToAirflowTasks") diff --git a/pyatlan_v9/model/assets/notebook_related.py b/pyatlan_v9/model/assets/notebook_related.py index adbc800cb..04e7520db 100644 --- a/pyatlan_v9/model/assets/notebook_related.py +++ b/pyatlan_v9/model/assets/notebook_related.py @@ -11,7 +11,6 @@ from __future__ import annotations - from msgspec import UNSET from .catalog_related import RelatedCatalog diff --git a/pyatlan_v9/model/assets/object_store.py b/pyatlan_v9/model/assets/object_store.py index e43abfd91..e31e0a407 100644 --- a/pyatlan_v9/model/assets/object_store.py +++ b/pyatlan_v9/model/assets/object_store.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .catalog_related import RelatedObjectStore from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .catalog_related import RelatedObjectStore # ============================================================================= # FLAT ASSET CLASS @@ -574,33 +574,36 @@ def _object_store_from_nested(nested: ObjectStoreNested) -> ObjectStore: _OBJECT_STORE_REL_FIELDS, ObjectStoreRelationshipAttributes, ) - return ObjectStore( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_object_store_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_object_store_attrs(attrs)) + kwargs.update(merged_rels) + return ObjectStore(**kwargs) def _object_store_to_nested_bytes(object_store: ObjectStore, serde: Serde) -> bytes: @@ -617,10 +620,7 @@ def _object_store_from_nested_bytes(data: bytes, serde: Serde) -> ObjectStore: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 ObjectStore.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/orchestration_related.py b/pyatlan_v9/model/assets/orchestration_related.py index 9cf6b2771..83e6e46aa 100644 --- a/pyatlan_v9/model/assets/orchestration_related.py +++ b/pyatlan_v9/model/assets/orchestration_related.py @@ -11,5 +11,4 @@ from __future__ import annotations - __all__ = [] diff --git a/pyatlan_v9/model/assets/partial.py b/pyatlan_v9/model/assets/partial.py index 2e17d3752..e50b67e5a 100644 --- a/pyatlan_v9/model/assets/partial.py +++ b/pyatlan_v9/model/assets/partial.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -40,20 +47,13 @@ from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .partial_related import RelatedPartial, RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .partial_related import RelatedPartial, RelatedPartialField, RelatedPartialObject # ============================================================================= # FLAT ASSET CLASS @@ -621,33 +621,36 @@ def _partial_from_nested(nested: PartialNested) -> Partial: _PARTIAL_REL_FIELDS, PartialRelationshipAttributes, ) - return Partial( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_partial_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_partial_attrs(attrs)) + kwargs.update(merged_rels) + return Partial(**kwargs) def _partial_to_nested_bytes(partial: Partial, serde: Serde) -> bytes: @@ -664,10 +667,7 @@ def _partial_from_nested_bytes(data: bytes, serde: Serde) -> Partial: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Partial.PARTIAL_STRUCTURE_JSON = KeywordField( "partialStructureJSON", "partialStructureJSON" diff --git a/pyatlan_v9/model/assets/partial_field.py b/pyatlan_v9/model/assets/partial_field.py index 29699bed2..1396881e8 100644 --- a/pyatlan_v9/model/assets/partial_field.py +++ b/pyatlan_v9/model/assets/partial_field.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,20 +49,13 @@ from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .partial_related import RelatedPartialField, RelatedPartialObject # ============================================================================= # FLAT ASSET CLASS @@ -658,33 +658,36 @@ def _partial_field_from_nested(nested: PartialFieldNested) -> PartialField: _PARTIAL_FIELD_REL_FIELDS, PartialFieldRelationshipAttributes, ) - return PartialField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_partial_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_partial_field_attrs(attrs)) + kwargs.update(merged_rels) + return PartialField(**kwargs) def _partial_field_to_nested_bytes(partial_field: PartialField, serde: Serde) -> bytes: @@ -701,10 +704,7 @@ def _partial_field_from_nested_bytes(data: bytes, serde: Serde) -> PartialField: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 PartialField.PARTIAL_DATA_TYPE = KeywordField("partialDataType", "partialDataType") PartialField.PARTIAL_STRUCTURE_JSON = KeywordField( diff --git a/pyatlan_v9/model/assets/partial_object.py b/pyatlan_v9/model/assets/partial_object.py index 808c44404..838f60cd5 100644 --- a/pyatlan_v9/model/assets/partial_object.py +++ b/pyatlan_v9/model/assets/partial_object.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,20 +49,13 @@ from .knowledge_related import RelatedKnowledgeFile from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor +from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .partial_related import RelatedPartialField, RelatedPartialObject # ============================================================================= # FLAT ASSET CLASS @@ -649,33 +649,36 @@ def _partial_object_from_nested(nested: PartialObjectNested) -> PartialObject: _PARTIAL_OBJECT_REL_FIELDS, PartialObjectRelationshipAttributes, ) - return PartialObject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_partial_object_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_partial_object_attrs(attrs)) + kwargs.update(merged_rels) + return PartialObject(**kwargs) def _partial_object_to_nested_bytes( @@ -694,10 +697,7 @@ def _partial_object_from_nested_bytes(data: bytes, serde: Serde) -> PartialObjec # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 PartialObject.PARTIAL_STRUCTURE_JSON = KeywordField( "partialStructureJSON", "partialStructureJSON" diff --git a/pyatlan_v9/model/assets/persona.py b/pyatlan_v9/model/assets/persona.py index 4f756d651..c62bcb1dc 100644 --- a/pyatlan_v9/model/assets/persona.py +++ b/pyatlan_v9/model/assets/persona.py @@ -18,6 +18,24 @@ from msgspec import UNSET, UnsetType +from pyatlan.model.enums import ( + AuthPolicyCategory, + AuthPolicyResourceCategory, + AuthPolicyType, + DataAction, + PersonaDomainAction, + PersonaGlossaryAction, + PersonaMetadataAction, +) +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + +from .access_control_related import RelatedAuthPolicy, RelatedPersona from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -41,24 +59,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan.model.enums import ( - AuthPolicyCategory, - AuthPolicyResourceCategory, - AuthPolicyType, - DataAction, - PersonaDomainAction, - PersonaGlossaryAction, - PersonaMetadataAction, -) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .access_control_related import RelatedAuthPolicy, RelatedPersona # ============================================================================= # FLAT ASSET CLASS @@ -775,33 +775,36 @@ def _persona_from_nested(nested: PersonaNested) -> Persona: _PERSONA_REL_FIELDS, PersonaRelationshipAttributes, ) - return Persona( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_persona_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_persona_attrs(attrs)) + kwargs.update(merged_rels) + return Persona(**kwargs) def _persona_to_nested_bytes(persona: Persona, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/power_bi.py b/pyatlan_v9/model/assets/power_bi.py index e849d06a2..f67895a70 100644 --- a/pyatlan_v9/model/assets/power_bi.py +++ b/pyatlan_v9/model/assets/power_bi.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,20 +48,13 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .power_bi_related import RelatedPowerBI from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .power_bi_related import RelatedPowerBI # ============================================================================= # FLAT ASSET CLASS @@ -649,33 +649,36 @@ def _power_bi_from_nested(nested: PowerBINested) -> PowerBI: _POWER_BI_REL_FIELDS, PowerBIRelationshipAttributes, ) - return PowerBI( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBI(**kwargs) def _power_bi_to_nested_bytes(power_bi: PowerBI, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/power_bi_app.py b/pyatlan_v9/model/assets/power_bi_app.py index 37349ed28..25b236126 100644 --- a/pyatlan_v9/model/assets/power_bi_app.py +++ b/pyatlan_v9/model/assets/power_bi_app.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,24 +48,17 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .power_bi_related import ( + RelatedPowerBIApp, + RelatedPowerBIDashboard, + RelatedPowerBIReport, +) from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .power_bi_related import ( - RelatedPowerBIApp, - RelatedPowerBIDashboard, - RelatedPowerBIReport, -) # ============================================================================= # FLAT ASSET CLASS @@ -718,33 +718,36 @@ def _power_bi_app_from_nested(nested: PowerBIAppNested) -> PowerBIApp: _POWER_BI_APP_REL_FIELDS, PowerBIAppRelationshipAttributes, ) - return PowerBIApp( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_app_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_app_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIApp(**kwargs) def _power_bi_app_to_nested_bytes(power_bi_app: PowerBIApp, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/power_bi_column.py b/pyatlan_v9/model/assets/power_bi_column.py index 24de2f6d7..66b8548e0 100644 --- a/pyatlan_v9/model/assets/power_bi_column.py +++ b/pyatlan_v9/model/assets/power_bi_column.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,24 +49,17 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .power_bi_related import ( + RelatedPowerBIColumn, + RelatedPowerBIMeasure, + RelatedPowerBITable, +) from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .power_bi_related import ( - RelatedPowerBIColumn, - RelatedPowerBIMeasure, - RelatedPowerBITable, -) # ============================================================================= # FLAT ASSET CLASS @@ -774,33 +774,36 @@ def _power_bi_column_from_nested(nested: PowerBIColumnNested) -> PowerBIColumn: _POWER_BI_COLUMN_REL_FIELDS, PowerBIColumnRelationshipAttributes, ) - return PowerBIColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_column_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIColumn(**kwargs) def _power_bi_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/power_bi_dashboard.py b/pyatlan_v9/model/assets/power_bi_dashboard.py index 7e81d261d..ae377d4f2 100644 --- a/pyatlan_v9/model/assets/power_bi_dashboard.py +++ b/pyatlan_v9/model/assets/power_bi_dashboard.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,25 +49,18 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .power_bi_related import ( RelatedPowerBIApp, RelatedPowerBIDashboard, RelatedPowerBITile, RelatedPowerBIWorkspace, ) +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -738,33 +738,36 @@ def _power_bi_dashboard_from_nested(nested: PowerBIDashboardNested) -> PowerBIDa _POWER_BI_DASHBOARD_REL_FIELDS, PowerBIDashboardRelationshipAttributes, ) - return PowerBIDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIDashboard(**kwargs) def _power_bi_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/power_bi_dataflow.py b/pyatlan_v9/model/assets/power_bi_dataflow.py index e620a8574..5a48e0d46 100644 --- a/pyatlan_v9/model/assets/power_bi_dataflow.py +++ b/pyatlan_v9/model/assets/power_bi_dataflow.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,19 +49,6 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .power_bi_related import ( RelatedPowerBIDataflow, RelatedPowerBIDataflowEntityColumn, @@ -63,6 +57,12 @@ RelatedPowerBITable, RelatedPowerBIWorkspace, ) +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -838,33 +838,36 @@ def _power_bi_dataflow_from_nested(nested: PowerBIDataflowNested) -> PowerBIData _POWER_BI_DATAFLOW_REL_FIELDS, PowerBIDataflowRelationshipAttributes, ) - return PowerBIDataflow( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_dataflow_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_dataflow_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIDataflow(**kwargs) def _power_bi_dataflow_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/power_bi_dataflow_entity_column.py b/pyatlan_v9/model/assets/power_bi_dataflow_entity_column.py index 95c14953f..1f56b359f 100644 --- a/pyatlan_v9/model/assets/power_bi_dataflow_entity_column.py +++ b/pyatlan_v9/model/assets/power_bi_dataflow_entity_column.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,20 +49,13 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .power_bi_related import RelatedPowerBIDataflow, RelatedPowerBIDataflowEntityColumn from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .power_bi_related import RelatedPowerBIDataflow, RelatedPowerBIDataflowEntityColumn # ============================================================================= # FLAT ASSET CLASS @@ -764,33 +764,36 @@ def _power_bi_dataflow_entity_column_from_nested( _POWER_BI_DATAFLOW_ENTITY_COLUMN_REL_FIELDS, PowerBIDataflowEntityColumnRelationshipAttributes, ) - return PowerBIDataflowEntityColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_dataflow_entity_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_dataflow_entity_column_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIDataflowEntityColumn(**kwargs) def _power_bi_dataflow_entity_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/power_bi_dataset.py b/pyatlan_v9/model/assets/power_bi_dataset.py index 4f952ead1..a5b23e63e 100644 --- a/pyatlan_v9/model/assets/power_bi_dataset.py +++ b/pyatlan_v9/model/assets/power_bi_dataset.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,19 +49,6 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .power_bi_related import ( RelatedPowerBIDataflow, RelatedPowerBIDataset, @@ -64,6 +58,12 @@ RelatedPowerBITile, RelatedPowerBIWorkspace, ) +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -750,33 +750,36 @@ def _power_bi_dataset_from_nested(nested: PowerBIDatasetNested) -> PowerBIDatase _POWER_BI_DATASET_REL_FIELDS, PowerBIDatasetRelationshipAttributes, ) - return PowerBIDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIDataset(**kwargs) def _power_bi_dataset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/power_bi_datasource.py b/pyatlan_v9/model/assets/power_bi_datasource.py index 8e05584a2..70f30bd98 100644 --- a/pyatlan_v9/model/assets/power_bi_datasource.py +++ b/pyatlan_v9/model/assets/power_bi_datasource.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,24 +49,17 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .power_bi_related import ( + RelatedPowerBIDataflow, + RelatedPowerBIDataset, + RelatedPowerBIDatasource, +) from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .power_bi_related import ( - RelatedPowerBIDataflow, - RelatedPowerBIDataset, - RelatedPowerBIDatasource, -) # ============================================================================= # FLAT ASSET CLASS @@ -713,33 +713,36 @@ def _power_bi_datasource_from_nested( _POWER_BI_DATASOURCE_REL_FIELDS, PowerBIDatasourceRelationshipAttributes, ) - return PowerBIDatasource( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_datasource_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_datasource_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIDatasource(**kwargs) def _power_bi_datasource_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/power_bi_measure.py b/pyatlan_v9/model/assets/power_bi_measure.py index 25166d4c6..b68334871 100644 --- a/pyatlan_v9/model/assets/power_bi_measure.py +++ b/pyatlan_v9/model/assets/power_bi_measure.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,24 +49,17 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .power_bi_related import ( + RelatedPowerBIColumn, + RelatedPowerBIMeasure, + RelatedPowerBITable, +) from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .power_bi_related import ( - RelatedPowerBIColumn, - RelatedPowerBIMeasure, - RelatedPowerBITable, -) # ============================================================================= # FLAT ASSET CLASS @@ -750,33 +750,36 @@ def _power_bi_measure_from_nested(nested: PowerBIMeasureNested) -> PowerBIMeasur _POWER_BI_MEASURE_REL_FIELDS, PowerBIMeasureRelationshipAttributes, ) - return PowerBIMeasure( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_measure_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_measure_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIMeasure(**kwargs) def _power_bi_measure_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/power_bi_page.py b/pyatlan_v9/model/assets/power_bi_page.py index 28c500798..6b8918707 100644 --- a/pyatlan_v9/model/assets/power_bi_page.py +++ b/pyatlan_v9/model/assets/power_bi_page.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,20 +49,13 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .power_bi_related import RelatedPowerBIPage, RelatedPowerBIReport from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .power_bi_related import RelatedPowerBIPage, RelatedPowerBIReport # ============================================================================= # FLAT ASSET CLASS @@ -698,33 +698,36 @@ def _power_bi_page_from_nested(nested: PowerBIPageNested) -> PowerBIPage: _POWER_BI_PAGE_REL_FIELDS, PowerBIPageRelationshipAttributes, ) - return PowerBIPage( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_page_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_page_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIPage(**kwargs) def _power_bi_page_to_nested_bytes(power_bi_page: PowerBIPage, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/power_bi_report.py b/pyatlan_v9/model/assets/power_bi_report.py index 6735a48e8..843de3c2f 100644 --- a/pyatlan_v9/model/assets/power_bi_report.py +++ b/pyatlan_v9/model/assets/power_bi_report.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,19 +49,6 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .power_bi_related import ( RelatedPowerBIApp, RelatedPowerBIDataset, @@ -63,6 +57,12 @@ RelatedPowerBITile, RelatedPowerBIWorkspace, ) +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -761,33 +761,36 @@ def _power_bi_report_from_nested(nested: PowerBIReportNested) -> PowerBIReport: _POWER_BI_REPORT_REL_FIELDS, PowerBIReportRelationshipAttributes, ) - return PowerBIReport( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_report_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_report_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIReport(**kwargs) def _power_bi_report_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/power_bi_table.py b/pyatlan_v9/model/assets/power_bi_table.py index 29e52dc8a..1ac7037c4 100644 --- a/pyatlan_v9/model/assets/power_bi_table.py +++ b/pyatlan_v9/model/assets/power_bi_table.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,19 +49,6 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .power_bi_related import ( RelatedPowerBIColumn, RelatedPowerBIDataflow, @@ -62,6 +56,12 @@ RelatedPowerBIMeasure, RelatedPowerBITable, ) +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -782,33 +782,36 @@ def _power_bi_table_from_nested(nested: PowerBITableNested) -> PowerBITable: _POWER_BI_TABLE_REL_FIELDS, PowerBITableRelationshipAttributes, ) - return PowerBITable( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_table_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_table_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBITable(**kwargs) def _power_bi_table_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/power_bi_tile.py b/pyatlan_v9/model/assets/power_bi_tile.py index 7fd726b1c..32156b014 100644 --- a/pyatlan_v9/model/assets/power_bi_tile.py +++ b/pyatlan_v9/model/assets/power_bi_tile.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,25 +49,18 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .power_bi_related import ( RelatedPowerBIDashboard, RelatedPowerBIDataset, RelatedPowerBIReport, RelatedPowerBITile, ) +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -719,33 +719,36 @@ def _power_bi_tile_from_nested(nested: PowerBITileNested) -> PowerBITile: _POWER_BI_TILE_REL_FIELDS, PowerBITileRelationshipAttributes, ) - return PowerBITile( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_tile_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_tile_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBITile(**kwargs) def _power_bi_tile_to_nested_bytes(power_bi_tile: PowerBITile, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/power_bi_workspace.py b/pyatlan_v9/model/assets/power_bi_workspace.py index ecdf89de2..80abc28d1 100644 --- a/pyatlan_v9/model/assets/power_bi_workspace.py +++ b/pyatlan_v9/model/assets/power_bi_workspace.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,19 +48,6 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .power_bi_related import ( RelatedPowerBIDashboard, RelatedPowerBIDataflow, @@ -61,6 +55,12 @@ RelatedPowerBIReport, RelatedPowerBIWorkspace, ) +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -746,33 +746,36 @@ def _power_bi_workspace_from_nested(nested: PowerBIWorkspaceNested) -> PowerBIWo _POWER_BI_WORKSPACE_REL_FIELDS, PowerBIWorkspaceRelationshipAttributes, ) - return PowerBIWorkspace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_power_bi_workspace_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_power_bi_workspace_attrs(attrs)) + kwargs.update(merged_rels) + return PowerBIWorkspace(**kwargs) def _power_bi_workspace_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/preset.py b/pyatlan_v9/model/assets/preset.py index 49be110d7..0f1f0a4aa 100644 --- a/pyatlan_v9/model/assets/preset.py +++ b/pyatlan_v9/model/assets/preset.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -40,20 +47,13 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .preset_related import RelatedPreset from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .preset_related import RelatedPreset # ============================================================================= # FLAT ASSET CLASS @@ -606,33 +606,36 @@ def _preset_from_nested(nested: PresetNested) -> Preset: _PRESET_REL_FIELDS, PresetRelationshipAttributes, ) - return Preset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_preset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_preset_attrs(attrs)) + kwargs.update(merged_rels) + return Preset(**kwargs) def _preset_to_nested_bytes(preset: Preset, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/preset_chart.py b/pyatlan_v9/model/assets/preset_chart.py index 5c9d51e7d..1781dc32a 100644 --- a/pyatlan_v9/model/assets/preset_chart.py +++ b/pyatlan_v9/model/assets/preset_chart.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,21 +49,13 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .preset_related import RelatedPresetChart, RelatedPresetDashboard from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .preset_related import RelatedPresetChart, RelatedPresetDashboard # ============================================================================= # FLAT ASSET CLASS @@ -691,33 +691,36 @@ def _preset_chart_from_nested(nested: PresetChartNested) -> PresetChart: _PRESET_CHART_REL_FIELDS, PresetChartRelationshipAttributes, ) - return PresetChart( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_preset_chart_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_preset_chart_attrs(attrs)) + kwargs.update(merged_rels) + return PresetChart(**kwargs) def _preset_chart_to_nested_bytes(preset_chart: PresetChart, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/preset_dashboard.py b/pyatlan_v9/model/assets/preset_dashboard.py index 19694df55..6b0e97636 100644 --- a/pyatlan_v9/model/assets/preset_dashboard.py +++ b/pyatlan_v9/model/assets/preset_dashboard.py @@ -20,6 +20,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,26 +50,18 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject -from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .preset_related import ( RelatedPresetChart, RelatedPresetDashboard, RelatedPresetDataset, RelatedPresetWorkspace, ) +from .process_related import RelatedProcess +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -763,33 +763,36 @@ def _preset_dashboard_from_nested(nested: PresetDashboardNested) -> PresetDashbo _PRESET_DASHBOARD_REL_FIELDS, PresetDashboardRelationshipAttributes, ) - return PresetDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_preset_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_preset_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return PresetDashboard(**kwargs) def _preset_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/preset_dataset.py b/pyatlan_v9/model/assets/preset_dataset.py index af4d4e414..354c41974 100644 --- a/pyatlan_v9/model/assets/preset_dataset.py +++ b/pyatlan_v9/model/assets/preset_dataset.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,21 +49,13 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .preset_related import RelatedPresetDashboard, RelatedPresetDataset from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .preset_related import RelatedPresetDashboard, RelatedPresetDataset # ============================================================================= # FLAT ASSET CLASS @@ -702,33 +702,36 @@ def _preset_dataset_from_nested(nested: PresetDatasetNested) -> PresetDataset: _PRESET_DATASET_REL_FIELDS, PresetDatasetRelationshipAttributes, ) - return PresetDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_preset_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_preset_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return PresetDataset(**kwargs) def _preset_dataset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/preset_workspace.py b/pyatlan_v9/model/assets/preset_workspace.py index 636c6ec1b..1ee7b2ee4 100644 --- a/pyatlan_v9/model/assets/preset_workspace.py +++ b/pyatlan_v9/model/assets/preset_workspace.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -40,21 +48,13 @@ from .model_related import RelatedModelAttribute, RelatedModelEntity from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject +from .preset_related import RelatedPresetDashboard, RelatedPresetWorkspace from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .preset_related import RelatedPresetDashboard, RelatedPresetWorkspace # ============================================================================= # FLAT ASSET CLASS @@ -747,33 +747,36 @@ def _preset_workspace_from_nested(nested: PresetWorkspaceNested) -> PresetWorksp _PRESET_WORKSPACE_REL_FIELDS, PresetWorkspaceRelationshipAttributes, ) - return PresetWorkspace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_preset_workspace_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_preset_workspace_attrs(attrs)) + kwargs.update(merged_rels) + return PresetWorkspace(**kwargs) def _preset_workspace_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/procedure.py b/pyatlan_v9/model/assets/procedure.py index 35ca9c232..145858aec 100644 --- a/pyatlan_v9/model/assets/procedure.py +++ b/pyatlan_v9/model/assets/procedure.py @@ -20,6 +20,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -60,14 +68,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .sql_related import RelatedProcedure, RelatedSchema # ============================================================================= @@ -1241,33 +1241,36 @@ def _procedure_from_nested(nested: ProcedureNested) -> Procedure: _PROCEDURE_REL_FIELDS, ProcedureRelationshipAttributes, ) - return Procedure( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_procedure_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_procedure_attrs(attrs)) + kwargs.update(merged_rels) + return Procedure(**kwargs) def _procedure_to_nested_bytes(procedure: Procedure, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/process.py b/pyatlan_v9/model/assets/process.py index a2f6694be..fa223ebdc 100644 --- a/pyatlan_v9/model/assets/process.py +++ b/pyatlan_v9/model/assets/process.py @@ -21,6 +21,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .adf_related import RelatedAdfActivity from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -49,21 +57,13 @@ from .matillion_related import RelatedMatillionComponent from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .power_bi_related import RelatedPowerBIDataflow +from .process_related import RelatedColumnProcess, RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedFunction, RelatedProcedure -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .process_related import RelatedColumnProcess, RelatedProcess # ============================================================================= # FLAT ASSET CLASS @@ -798,33 +798,36 @@ def _process_from_nested(nested: ProcessNested) -> Process: _PROCESS_REL_FIELDS, ProcessRelationshipAttributes, ) - return Process( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_process_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_process_attrs(attrs)) + kwargs.update(merged_rels) + return Process(**kwargs) def _process_to_nested_bytes(process: Process, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/process_execution.py b/pyatlan_v9/model/assets/process_execution.py index 1e9d1d281..2e666b9e7 100644 --- a/pyatlan_v9/model/assets/process_execution.py +++ b/pyatlan_v9/model/assets/process_execution.py @@ -19,8 +19,15 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField +from .asset_related import RelatedProcessExecution from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -42,13 +49,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde - -from .asset_related import RelatedProcessExecution # ============================================================================= # FLAT ASSET CLASS @@ -2658,33 +2658,36 @@ def _process_execution_from_nested(nested: ProcessExecutionNested) -> ProcessExe _PROCESS_EXECUTION_REL_FIELDS, ProcessExecutionRelationshipAttributes, ) - return ProcessExecution( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_process_execution_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_process_execution_attrs(attrs)) + kwargs.update(merged_rels) + return ProcessExecution(**kwargs) def _process_execution_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/purpose.py b/pyatlan_v9/model/assets/purpose.py index fac2240dc..d42dcde99 100644 --- a/pyatlan_v9/model/assets/purpose.py +++ b/pyatlan_v9/model/assets/purpose.py @@ -18,6 +18,23 @@ from msgspec import UNSET, UnsetType +from pyatlan.model.enums import ( + AuthPolicyCategory, + AuthPolicyResourceCategory, + AuthPolicyType, + DataAction, + PurposeMetadataAction, +) +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.core import AtlanTagName +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + +from .access_control_related import RelatedAuthPolicy, RelatedPurpose from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -41,23 +58,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan.model.enums import ( - AuthPolicyCategory, - AuthPolicyResourceCategory, - AuthPolicyType, - DataAction, - PurposeMetadataAction, -) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.core import AtlanTagName -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .access_control_related import RelatedAuthPolicy, RelatedPurpose # ============================================================================= # FLAT ASSET CLASS @@ -778,33 +778,36 @@ def _purpose_from_nested(nested: PurposeNested) -> Purpose: _PURPOSE_REL_FIELDS, PurposeRelationshipAttributes, ) - return Purpose( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_purpose_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_purpose_attrs(attrs)) + kwargs.update(merged_rels) + return Purpose(**kwargs) def _purpose_to_nested_bytes(purpose: Purpose, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/qlik.py b/pyatlan_v9/model/assets/qlik.py index 46f9793d9..1ab52f0c0 100644 --- a/pyatlan_v9/model/assets/qlik.py +++ b/pyatlan_v9/model/assets/qlik.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,19 +49,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .qlik_related import RelatedQlik from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .qlik_related import RelatedQlik # ============================================================================= # FLAT ASSET CLASS @@ -639,33 +639,36 @@ def _qlik_from_nested(nested: QlikNested) -> Qlik: _QLIK_REL_FIELDS, QlikRelationshipAttributes, ) - return Qlik( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_qlik_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_qlik_attrs(attrs)) + kwargs.update(merged_rels) + return Qlik(**kwargs) def _qlik_to_nested_bytes(qlik: Qlik, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/qlik_app.py b/pyatlan_v9/model/assets/qlik_app.py index 2c988d200..0395229f7 100644 --- a/pyatlan_v9/model/assets/qlik_app.py +++ b/pyatlan_v9/model/assets/qlik_app.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,19 +50,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .qlik_related import RelatedQlikApp, RelatedQlikSheet, RelatedQlikSpace from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .qlik_related import RelatedQlikApp, RelatedQlikSheet, RelatedQlikSpace # ============================================================================= # FLAT ASSET CLASS @@ -719,33 +719,36 @@ def _qlik_app_from_nested(nested: QlikAppNested) -> QlikApp: _QLIK_APP_REL_FIELDS, QlikAppRelationshipAttributes, ) - return QlikApp( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_qlik_app_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_qlik_app_attrs(attrs)) + kwargs.update(merged_rels) + return QlikApp(**kwargs) def _qlik_app_to_nested_bytes(qlik_app: QlikApp, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/qlik_chart.py b/pyatlan_v9/model/assets/qlik_chart.py index 8a9cc5b12..ec177d130 100644 --- a/pyatlan_v9/model/assets/qlik_chart.py +++ b/pyatlan_v9/model/assets/qlik_chart.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,19 +50,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .qlik_related import RelatedQlikChart, RelatedQlikColumn, RelatedQlikSheet from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .qlik_related import RelatedQlikChart, RelatedQlikColumn, RelatedQlikSheet # ============================================================================= # FLAT ASSET CLASS @@ -716,33 +716,36 @@ def _qlik_chart_from_nested(nested: QlikChartNested) -> QlikChart: _QLIK_CHART_REL_FIELDS, QlikChartRelationshipAttributes, ) - return QlikChart( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_qlik_chart_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_qlik_chart_attrs(attrs)) + kwargs.update(merged_rels) + return QlikChart(**kwargs) def _qlik_chart_to_nested_bytes(qlik_chart: QlikChart, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/qlik_column.py b/pyatlan_v9/model/assets/qlik_column.py index fa7cf6a22..261fed2b9 100644 --- a/pyatlan_v9/model/assets/qlik_column.py +++ b/pyatlan_v9/model/assets/qlik_column.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,24 +50,17 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .qlik_related import ( RelatedQlikChart, RelatedQlikColumn, RelatedQlikDataset, RelatedQlikSheet, ) +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -729,33 +729,36 @@ def _qlik_column_from_nested(nested: QlikColumnNested) -> QlikColumn: _QLIK_COLUMN_REL_FIELDS, QlikColumnRelationshipAttributes, ) - return QlikColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_qlik_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_qlik_column_attrs(attrs)) + kwargs.update(merged_rels) + return QlikColumn(**kwargs) def _qlik_column_to_nested_bytes(qlik_column: QlikColumn, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/qlik_dataset.py b/pyatlan_v9/model/assets/qlik_dataset.py index 2eeb1de5d..f2e856004 100644 --- a/pyatlan_v9/model/assets/qlik_dataset.py +++ b/pyatlan_v9/model/assets/qlik_dataset.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,19 +50,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .qlik_related import RelatedQlikColumn, RelatedQlikDataset, RelatedQlikSpace from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .qlik_related import RelatedQlikColumn, RelatedQlikDataset, RelatedQlikSpace # ============================================================================= # FLAT ASSET CLASS @@ -723,33 +723,36 @@ def _qlik_dataset_from_nested(nested: QlikDatasetNested) -> QlikDataset: _QLIK_DATASET_REL_FIELDS, QlikDatasetRelationshipAttributes, ) - return QlikDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_qlik_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_qlik_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return QlikDataset(**kwargs) def _qlik_dataset_to_nested_bytes(qlik_dataset: QlikDataset, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/qlik_sheet.py b/pyatlan_v9/model/assets/qlik_sheet.py index 7bf3f19eb..09f1f2126 100644 --- a/pyatlan_v9/model/assets/qlik_sheet.py +++ b/pyatlan_v9/model/assets/qlik_sheet.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,24 +50,17 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .qlik_related import ( RelatedQlikApp, RelatedQlikChart, RelatedQlikColumn, RelatedQlikSheet, ) +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -702,33 +702,36 @@ def _qlik_sheet_from_nested(nested: QlikSheetNested) -> QlikSheet: _QLIK_SHEET_REL_FIELDS, QlikSheetRelationshipAttributes, ) - return QlikSheet( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_qlik_sheet_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_qlik_sheet_attrs(attrs)) + kwargs.update(merged_rels) + return QlikSheet(**kwargs) def _qlik_sheet_to_nested_bytes(qlik_sheet: QlikSheet, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/qlik_space.py b/pyatlan_v9/model/assets/qlik_space.py index 43f965936..df5bc44b4 100644 --- a/pyatlan_v9/model/assets/qlik_space.py +++ b/pyatlan_v9/model/assets/qlik_space.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,19 +49,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .qlik_related import RelatedQlikApp, RelatedQlikDataset, RelatedQlikSpace from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .qlik_related import RelatedQlikApp, RelatedQlikDataset, RelatedQlikSpace # ============================================================================= # FLAT ASSET CLASS @@ -670,33 +670,36 @@ def _qlik_space_from_nested(nested: QlikSpaceNested) -> QlikSpace: _QLIK_SPACE_REL_FIELDS, QlikSpaceRelationshipAttributes, ) - return QlikSpace( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_qlik_space_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_qlik_space_attrs(attrs)) + kwargs.update(merged_rels) + return QlikSpace(**kwargs) def _qlik_space_to_nested_bytes(qlik_space: QlikSpace, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/query.py b/pyatlan_v9/model/assets/query.py index 7e06e4c4d..c6b76750b 100644 --- a/pyatlan_v9/model/assets/query.py +++ b/pyatlan_v9/model/assets/query.py @@ -20,6 +20,15 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan.model.enums import AtlanConnectorType +from pyatlan.utils import validate_required_fields +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -60,15 +69,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan.model.enums import AtlanConnectorType -from pyatlan.utils import validate_required_fields -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sql_related import RelatedColumn, RelatedQuery, RelatedTable, RelatedView # ============================================================================= @@ -1256,33 +1256,36 @@ def _query_from_nested(nested: QueryNested) -> Query: _QUERY_REL_FIELDS, QueryRelationshipAttributes, ) - return Query( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_query_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_query_attrs(attrs)) + kwargs.update(merged_rels) + return Query(**kwargs) def _query_to_nested_bytes(query: Query, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/quick_sight.py b/pyatlan_v9/model/assets/quick_sight.py index 9d8ecb6ce..39886fb2b 100644 --- a/pyatlan_v9/model/assets/quick_sight.py +++ b/pyatlan_v9/model/assets/quick_sight.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,19 +48,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .quick_sight_related import RelatedQuickSight from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .quick_sight_related import RelatedQuickSight # ============================================================================= # FLAT ASSET CLASS @@ -599,33 +599,36 @@ def _quick_sight_from_nested(nested: QuickSightNested) -> QuickSight: _QUICK_SIGHT_REL_FIELDS, QuickSightRelationshipAttributes, ) - return QuickSight( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_quick_sight_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_quick_sight_attrs(attrs)) + kwargs.update(merged_rels) + return QuickSight(**kwargs) def _quick_sight_to_nested_bytes(quick_sight: QuickSight, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/quick_sight_analysis.py b/pyatlan_v9/model/assets/quick_sight_analysis.py index 88a47788e..f7211e30f 100644 --- a/pyatlan_v9/model/assets/quick_sight_analysis.py +++ b/pyatlan_v9/model/assets/quick_sight_analysis.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,24 +50,16 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .quick_sight_related import ( RelatedQuickSightAnalysis, RelatedQuickSightAnalysisVisual, RelatedQuickSightFolder, ) +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -742,33 +742,36 @@ def _quick_sight_analysis_from_nested( _QUICK_SIGHT_ANALYSIS_REL_FIELDS, QuickSightAnalysisRelationshipAttributes, ) - return QuickSightAnalysis( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_quick_sight_analysis_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_quick_sight_analysis_attrs(attrs)) + kwargs.update(merged_rels) + return QuickSightAnalysis(**kwargs) def _quick_sight_analysis_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/quick_sight_analysis_visual.py b/pyatlan_v9/model/assets/quick_sight_analysis_visual.py index b1b8488d5..699055111 100644 --- a/pyatlan_v9/model/assets/quick_sight_analysis_visual.py +++ b/pyatlan_v9/model/assets/quick_sight_analysis_visual.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,23 +50,15 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .quick_sight_related import ( + RelatedQuickSightAnalysis, + RelatedQuickSightAnalysisVisual, +) from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .quick_sight_related import ( - RelatedQuickSightAnalysis, - RelatedQuickSightAnalysisVisual, -) # ============================================================================= # FLAT ASSET CLASS @@ -722,33 +722,36 @@ def _quick_sight_analysis_visual_from_nested( _QUICK_SIGHT_ANALYSIS_VISUAL_REL_FIELDS, QuickSightAnalysisVisualRelationshipAttributes, ) - return QuickSightAnalysisVisual( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_quick_sight_analysis_visual_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_quick_sight_analysis_visual_attrs(attrs)) + kwargs.update(merged_rels) + return QuickSightAnalysisVisual(**kwargs) def _quick_sight_analysis_visual_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/quick_sight_dashboard.py b/pyatlan_v9/model/assets/quick_sight_dashboard.py index a5f5ead20..07c9d7095 100644 --- a/pyatlan_v9/model/assets/quick_sight_dashboard.py +++ b/pyatlan_v9/model/assets/quick_sight_dashboard.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,24 +50,16 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .quick_sight_related import ( RelatedQuickSightDashboard, RelatedQuickSightDashboardVisual, RelatedQuickSightFolder, ) +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -727,33 +727,36 @@ def _quick_sight_dashboard_from_nested( _QUICK_SIGHT_DASHBOARD_REL_FIELDS, QuickSightDashboardRelationshipAttributes, ) - return QuickSightDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_quick_sight_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_quick_sight_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return QuickSightDashboard(**kwargs) def _quick_sight_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/quick_sight_dashboard_visual.py b/pyatlan_v9/model/assets/quick_sight_dashboard_visual.py index 560532e5c..dbc4dd72a 100644 --- a/pyatlan_v9/model/assets/quick_sight_dashboard_visual.py +++ b/pyatlan_v9/model/assets/quick_sight_dashboard_visual.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,23 +50,15 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .quick_sight_related import ( + RelatedQuickSightDashboard, + RelatedQuickSightDashboardVisual, +) from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .quick_sight_related import ( - RelatedQuickSightDashboard, - RelatedQuickSightDashboardVisual, -) # ============================================================================= # FLAT ASSET CLASS @@ -724,33 +724,36 @@ def _quick_sight_dashboard_visual_from_nested( _QUICK_SIGHT_DASHBOARD_VISUAL_REL_FIELDS, QuickSightDashboardVisualRelationshipAttributes, ) - return QuickSightDashboardVisual( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_quick_sight_dashboard_visual_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_quick_sight_dashboard_visual_attrs(attrs)) + kwargs.update(merged_rels) + return QuickSightDashboardVisual(**kwargs) def _quick_sight_dashboard_visual_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/quick_sight_dataset.py b/pyatlan_v9/model/assets/quick_sight_dataset.py index 81f220c7c..c3383f66e 100644 --- a/pyatlan_v9/model/assets/quick_sight_dataset.py +++ b/pyatlan_v9/model/assets/quick_sight_dataset.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,24 +50,16 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .quick_sight_related import ( RelatedQuickSightDataset, RelatedQuickSightDatasetField, RelatedQuickSightFolder, ) +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -723,33 +723,36 @@ def _quick_sight_dataset_from_nested( _QUICK_SIGHT_DATASET_REL_FIELDS, QuickSightDatasetRelationshipAttributes, ) - return QuickSightDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_quick_sight_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_quick_sight_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return QuickSightDataset(**kwargs) def _quick_sight_dataset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/quick_sight_dataset_field.py b/pyatlan_v9/model/assets/quick_sight_dataset_field.py index 046683637..3ae3f9c46 100644 --- a/pyatlan_v9/model/assets/quick_sight_dataset_field.py +++ b/pyatlan_v9/model/assets/quick_sight_dataset_field.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,20 +50,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .quick_sight_related import RelatedQuickSightDataset, RelatedQuickSightDatasetField from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .quick_sight_related import RelatedQuickSightDataset, RelatedQuickSightDatasetField # ============================================================================= # FLAT ASSET CLASS @@ -720,33 +720,36 @@ def _quick_sight_dataset_field_from_nested( _QUICK_SIGHT_DATASET_FIELD_REL_FIELDS, QuickSightDatasetFieldRelationshipAttributes, ) - return QuickSightDatasetField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_quick_sight_dataset_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_quick_sight_dataset_field_attrs(attrs)) + kwargs.update(merged_rels) + return QuickSightDatasetField(**kwargs) def _quick_sight_dataset_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/quick_sight_folder.py b/pyatlan_v9/model/assets/quick_sight_folder.py index afbbfacc1..171b8d902 100644 --- a/pyatlan_v9/model/assets/quick_sight_folder.py +++ b/pyatlan_v9/model/assets/quick_sight_folder.py @@ -18,6 +18,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,25 +49,17 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess -from .referenceable_related import RelatedReferenceable -from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .quick_sight_related import ( RelatedQuickSightAnalysis, RelatedQuickSightDashboard, RelatedQuickSightDataset, RelatedQuickSightFolder, ) +from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -707,33 +707,36 @@ def _quick_sight_folder_from_nested(nested: QuickSightFolderNested) -> QuickSigh _QUICK_SIGHT_FOLDER_REL_FIELDS, QuickSightFolderRelationshipAttributes, ) - return QuickSightFolder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_quick_sight_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_quick_sight_folder_attrs(attrs)) + kwargs.update(merged_rels) + return QuickSightFolder(**kwargs) def _quick_sight_folder_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/readme.py b/pyatlan_v9/model/assets/readme.py index 53e016ad7..800f6edd9 100644 --- a/pyatlan_v9/model/assets/readme.py +++ b/pyatlan_v9/model/assets/readme.py @@ -20,6 +20,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,18 +53,10 @@ from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .resource_related import RelatedFile, RelatedLink, RelatedReadme # ============================================================================= # FLAT ASSET CLASS @@ -705,33 +705,36 @@ def _readme_from_nested(nested: ReadmeNested) -> Readme: _README_REL_FIELDS, ReadmeRelationshipAttributes, ) - return Readme( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_readme_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_readme_attrs(attrs)) + kwargs.update(merged_rels) + return Readme(**kwargs) def _readme_to_nested_bytes(readme: Readme, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/readme_template.py b/pyatlan_v9/model/assets/readme_template.py index 0bbfc6313..765fdf637 100644 --- a/pyatlan_v9/model/assets/readme_template.py +++ b/pyatlan_v9/model/assets/readme_template.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,22 +49,15 @@ from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .resource_related import ( RelatedFile, RelatedLink, RelatedReadme, RelatedReadmeTemplate, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -638,33 +638,36 @@ def _readme_template_from_nested(nested: ReadmeTemplateNested) -> ReadmeTemplate _README_TEMPLATE_REL_FIELDS, ReadmeTemplateRelationshipAttributes, ) - return ReadmeTemplate( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_readme_template_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_readme_template_attrs(attrs)) + kwargs.update(merged_rels) + return ReadmeTemplate(**kwargs) def _readme_template_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/redash.py b/pyatlan_v9/model/assets/redash.py index 2007e6da4..d1cb999cf 100644 --- a/pyatlan_v9/model/assets/redash.py +++ b/pyatlan_v9/model/assets/redash.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,19 +48,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .redash_related import RelatedRedash from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .redash_related import RelatedRedash # ============================================================================= # FLAT ASSET CLASS @@ -579,33 +579,36 @@ def _redash_from_nested(nested: RedashNested) -> Redash: _REDASH_REL_FIELDS, RedashRelationshipAttributes, ) - return Redash( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_redash_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_redash_attrs(attrs)) + kwargs.update(merged_rels) + return Redash(**kwargs) def _redash_to_nested_bytes(redash: Redash, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/redash_dashboard.py b/pyatlan_v9/model/assets/redash_dashboard.py index ba484f2f9..89a5b3b2b 100644 --- a/pyatlan_v9/model/assets/redash_dashboard.py +++ b/pyatlan_v9/model/assets/redash_dashboard.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -41,19 +48,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .redash_related import RelatedRedashDashboard from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .redash_related import RelatedRedashDashboard # ============================================================================= # FLAT ASSET CLASS @@ -602,33 +602,36 @@ def _redash_dashboard_from_nested(nested: RedashDashboardNested) -> RedashDashbo _REDASH_DASHBOARD_REL_FIELDS, RedashDashboardRelationshipAttributes, ) - return RedashDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_redash_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_redash_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return RedashDashboard(**kwargs) def _redash_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/redash_query.py b/pyatlan_v9/model/assets/redash_query.py index bc0ea6f5c..502415dc6 100644 --- a/pyatlan_v9/model/assets/redash_query.py +++ b/pyatlan_v9/model/assets/redash_query.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,19 +49,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .redash_related import RelatedRedashQuery, RelatedRedashVisualization from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .redash_related import RelatedRedashQuery, RelatedRedashVisualization # ============================================================================= # FLAT ASSET CLASS @@ -656,33 +656,36 @@ def _redash_query_from_nested(nested: RedashQueryNested) -> RedashQuery: _REDASH_QUERY_REL_FIELDS, RedashQueryRelationshipAttributes, ) - return RedashQuery( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_redash_query_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_redash_query_attrs(attrs)) + kwargs.update(merged_rels) + return RedashQuery(**kwargs) def _redash_query_to_nested_bytes(redash_query: RedashQuery, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/redash_visualization.py b/pyatlan_v9/model/assets/redash_visualization.py index b16cd11ed..ac4e45a9f 100644 --- a/pyatlan_v9/model/assets/redash_visualization.py +++ b/pyatlan_v9/model/assets/redash_visualization.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,19 +49,12 @@ from .monte_carlo_related import RelatedMCIncident, RelatedMCMonitor from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess +from .redash_related import RelatedRedashQuery, RelatedRedashVisualization from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .redash_related import RelatedRedashQuery, RelatedRedashVisualization # ============================================================================= # FLAT ASSET CLASS @@ -647,33 +647,36 @@ def _redash_visualization_from_nested( _REDASH_VISUALIZATION_REL_FIELDS, RedashVisualizationRelationshipAttributes, ) - return RedashVisualization( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_redash_visualization_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_redash_visualization_attrs(attrs)) + kwargs.update(merged_rels) + return RedashVisualization(**kwargs) def _redash_visualization_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/referenceable.py b/pyatlan_v9/model/assets/referenceable.py index ff643b5ff..dd8fa8028 100644 --- a/pyatlan_v9/model/assets/referenceable.py +++ b/pyatlan_v9/model/assets/referenceable.py @@ -33,7 +33,7 @@ ) from pyatlan_v9.model.serde import Serde, get_serde -from .entity import AtlasClassification, Entity +from .entity import Entity from .gtc_related import RelatedAtlasGlossaryTerm from .referenceable_related import RelatedReferenceable @@ -295,7 +295,7 @@ class ReferenceableNested( update_time: Union[Any, UnsetType] = UNSET created_by: Union[Any, UnsetType] = UNSET updated_by: Union[Any, UnsetType] = UNSET - classifications: Union[List[AtlasClassification], None, UnsetType] = UNSET + classifications: Union[Any, UnsetType] = UNSET classification_names: Union[Any, UnsetType] = UNSET meanings: Union[Any, UnsetType] = UNSET labels: Union[Any, UnsetType] = UNSET @@ -409,32 +409,36 @@ def _referenceable_from_nested(nested: ReferenceableNested) -> Referenceable: _REFERENCEABLE_REL_FIELDS, ReferenceableRelationshipAttributes, ) - return Referenceable( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_referenceable_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_referenceable_attrs(attrs)) + kwargs.update(merged_rels) + return Referenceable(**kwargs) def _referenceable_to_nested_bytes(referenceable: Referenceable, serde: Serde) -> bytes: @@ -461,46 +465,6 @@ def _referenceable_from_nested_bytes(data: bytes, serde: Serde) -> Referenceable Referenceable.MEANINGS = RelationField("meanings") Referenceable.USER_DEF_RELATIONSHIP_TO = RelationField("userDefRelationshipTo") Referenceable.USER_DEF_RELATIONSHIP_FROM = RelationField("userDefRelationshipFrom") -# --------------------------------------------------------------------------- -# Referenceable internal field descriptors (entity-level, not in typedef) -# --------------------------------------------------------------------------- - -Referenceable.STATUS = InternalKeywordField("status", "__state", "__state") -Referenceable.GUID = InternalKeywordField("guid", "__guid", "__guid") -Referenceable.TYPE_NAME = InternalKeywordTextField( - "typeName", "__typeName.keyword", "__typeName", "__typeName" -) -Referenceable.CREATED_BY = InternalKeywordField( - "createdBy", "__createdBy", "__createdBy" -) -Referenceable.UPDATED_BY = InternalKeywordField( - "updatedBy", "__modifiedBy", "__modifiedBy" -) -Referenceable.ATLAN_TAGS = InternalKeywordTextField( - "classificationNames", - "__traitNames", - "__classificationsText", - "__classificationNames", -) -Referenceable.PROPAGATED_ATLAN_TAGS = InternalKeywordTextField( - "classificationNames", - "__propagatedTraitNames", - "__classificationsText", - "__propagatedClassificationNames", -) -Referenceable.ASSIGNED_TERMS = InternalKeywordTextField( - "meanings", "__meanings", "__meaningsText", "__meanings" -) -Referenceable.SUPER_TYPE_NAMES = InternalKeywordTextField( - "typeName", "__superTypeNames.keyword", "__superTypeNames", "__superTypeNames" -) -Referenceable.CREATE_TIME = InternalNumericField( - "createTime", "__timestamp", "__timestamp" -) -Referenceable.UPDATE_TIME = InternalNumericField( - "updateTime", "__modificationTimestamp", "__modificationTimestamp" -) -Referenceable.CUSTOM_ATTRIBUTES = TextField("customAttributes", "customAttributes") Referenceable.TYPE_NAME = InternalKeywordTextField( "typeName", "__typeName.keyword", "__typeName", "__typeName" diff --git a/pyatlan_v9/model/assets/resource.py b/pyatlan_v9/model/assets/resource.py index 15c354196..4192ad2ed 100644 --- a/pyatlan_v9/model/assets/resource.py +++ b/pyatlan_v9/model/assets/resource.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -42,17 +49,10 @@ from .partial_related import RelatedPartialField, RelatedPartialObject from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable +from .resource_related import RelatedFile, RelatedLink, RelatedReadme, RelatedResource from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .resource_related import RelatedFile, RelatedLink, RelatedReadme, RelatedResource # ============================================================================= # FLAT ASSET CLASS @@ -607,33 +607,36 @@ def _resource_from_nested(nested: ResourceNested) -> Resource: _RESOURCE_REL_FIELDS, ResourceRelationshipAttributes, ) - return Resource( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_resource_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_resource_attrs(attrs)) + kwargs.update(merged_rels) + return Resource(**kwargs) def _resource_to_nested_bytes(resource: Resource, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/s3.py b/pyatlan_v9/model/assets/s3.py index 2f68a24a4..9f61d22e8 100644 --- a/pyatlan_v9/model/assets/s3.py +++ b/pyatlan_v9/model/assets/s3.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,17 +51,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .s3_related import RelatedS3 from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .s3_related import RelatedS3 # ============================================================================= # FLAT ASSET CLASS @@ -693,33 +693,36 @@ def _s3_from_nested(nested: S3Nested) -> S3: _S3_REL_FIELDS, S3RelationshipAttributes, ) - return S3( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_s3_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_s3_attrs(attrs)) + kwargs.update(merged_rels) + return S3(**kwargs) def _s3_to_nested_bytes(s3: S3, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/s3_bucket.py b/pyatlan_v9/model/assets/s3_bucket.py index 1d54b609a..9f7ffdd83 100644 --- a/pyatlan_v9/model/assets/s3_bucket.py +++ b/pyatlan_v9/model/assets/s3_bucket.py @@ -19,6 +19,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,18 +52,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .s3_related import RelatedS3Bucket, RelatedS3Object, RelatedS3Prefix from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid - -from .s3_related import RelatedS3Bucket, RelatedS3Object, RelatedS3Prefix # ============================================================================= # FLAT ASSET CLASS @@ -788,33 +788,36 @@ def _s3_bucket_from_nested(nested: S3BucketNested) -> S3Bucket: _S3_BUCKET_REL_FIELDS, S3BucketRelationshipAttributes, ) - return S3Bucket( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_s3_bucket_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_s3_bucket_attrs(attrs)) + kwargs.update(merged_rels) + return S3Bucket(**kwargs) def _s3_bucket_to_nested_bytes(s3_bucket: S3Bucket, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/s3_object.py b/pyatlan_v9/model/assets/s3_object.py index c125ddb92..8bfa2d257 100644 --- a/pyatlan_v9/model/assets/s3_object.py +++ b/pyatlan_v9/model/assets/s3_object.py @@ -20,6 +20,15 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan.model.utils import construct_object_key +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,19 +54,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .s3_related import RelatedS3Bucket, RelatedS3Object, RelatedS3Prefix from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan.model.utils import construct_object_key -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - -from .s3_related import RelatedS3Bucket, RelatedS3Object, RelatedS3Prefix # ============================================================================= # FLAT ASSET CLASS @@ -994,33 +994,36 @@ def _s3_object_from_nested(nested: S3ObjectNested) -> S3Object: _S3_OBJECT_REL_FIELDS, S3ObjectRelationshipAttributes, ) - return S3Object( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_s3_object_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_s3_object_attrs(attrs)) + kwargs.update(merged_rels) + return S3Object(**kwargs) def _s3_object_to_nested_bytes(s3_object: S3Object, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/s3_prefix.py b/pyatlan_v9/model/assets/s3_prefix.py index 35d1cac02..81f4e26ba 100644 --- a/pyatlan_v9/model/assets/s3_prefix.py +++ b/pyatlan_v9/model/assets/s3_prefix.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,17 +52,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .s3_related import RelatedS3Bucket, RelatedS3Object, RelatedS3Prefix from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .s3_related import RelatedS3Bucket, RelatedS3Object, RelatedS3Prefix # ============================================================================= # FLAT ASSET CLASS @@ -784,33 +784,36 @@ def _s3_prefix_from_nested(nested: S3PrefixNested) -> S3Prefix: _S3_PREFIX_REL_FIELDS, S3PrefixRelationshipAttributes, ) - return S3Prefix( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_s3_prefix_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_s3_prefix_attrs(attrs)) + kwargs.update(merged_rels) + return S3Prefix(**kwargs) def _s3_prefix_to_nested_bytes(s3_prefix: S3Prefix, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/saa_s.py b/pyatlan_v9/model/assets/saa_s.py index d1106335b..e5fda8626 100644 --- a/pyatlan_v9/model/assets/saa_s.py +++ b/pyatlan_v9/model/assets/saa_s.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -30,6 +37,7 @@ _extract_asset_attrs, _populate_asset_attrs, ) +from .catalog_related import RelatedSaaS from .context_related import RelatedContextRepository from .data_contract_related import RelatedDataContract from .data_mesh_related import RelatedDataProduct @@ -46,14 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .catalog_related import RelatedSaaS # ============================================================================= # FLAT ASSET CLASS @@ -566,33 +566,36 @@ def _saa_s_from_nested(nested: SaaSNested) -> SaaS: _SAA_S_REL_FIELDS, SaaSRelationshipAttributes, ) - return SaaS( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_saa_s_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_saa_s_attrs(attrs)) + kwargs.update(merged_rels) + return SaaS(**kwargs) def _saa_s_to_nested_bytes(saa_s: SaaS, serde: Serde) -> bytes: @@ -609,10 +612,7 @@ def _saa_s_from_nested_bytes(data: bytes, serde: Serde) -> SaaS: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 SaaS.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") SaaS.INPUT_TO_AIRFLOW_TASKS = RelationField("inputToAirflowTasks") diff --git a/pyatlan_v9/model/assets/sage_maker.py b/pyatlan_v9/model/assets/sage_maker.py index f22900a6f..115bc82b8 100644 --- a/pyatlan_v9/model/assets/sage_maker.py +++ b/pyatlan_v9/model/assets/sage_maker.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,17 +51,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sage_maker_related import RelatedSageMaker from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sage_maker_related import RelatedSageMaker # ============================================================================= # FLAT ASSET CLASS @@ -773,33 +773,36 @@ def _sage_maker_from_nested(nested: SageMakerNested) -> SageMaker: _SAGE_MAKER_REL_FIELDS, SageMakerRelationshipAttributes, ) - return SageMaker( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_attrs(attrs)) + kwargs.update(merged_rels) + return SageMaker(**kwargs) def _sage_maker_to_nested_bytes(sage_maker: SageMaker, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sage_maker_feature.py b/pyatlan_v9/model/assets/sage_maker_feature.py index 03830952f..b3475e752 100644 --- a/pyatlan_v9/model/assets/sage_maker_feature.py +++ b/pyatlan_v9/model/assets/sage_maker_feature.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,17 +52,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sage_maker_related import RelatedSageMakerFeature, RelatedSageMakerFeatureGroup from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sage_maker_related import RelatedSageMakerFeature, RelatedSageMakerFeatureGroup # ============================================================================= # FLAT ASSET CLASS @@ -860,33 +860,36 @@ def _sage_maker_feature_from_nested(nested: SageMakerFeatureNested) -> SageMaker _SAGE_MAKER_FEATURE_REL_FIELDS, SageMakerFeatureRelationshipAttributes, ) - return SageMakerFeature( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_feature_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_feature_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerFeature(**kwargs) def _sage_maker_feature_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sage_maker_feature_group.py b/pyatlan_v9/model/assets/sage_maker_feature_group.py index bc0c6ca07..c063fba43 100644 --- a/pyatlan_v9/model/assets/sage_maker_feature_group.py +++ b/pyatlan_v9/model/assets/sage_maker_feature_group.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,17 +51,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sage_maker_related import RelatedSageMakerFeature, RelatedSageMakerFeatureGroup from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sage_maker_related import RelatedSageMakerFeature, RelatedSageMakerFeatureGroup # ============================================================================= # FLAT ASSET CLASS @@ -858,33 +858,36 @@ def _sage_maker_feature_group_from_nested( _SAGE_MAKER_FEATURE_GROUP_REL_FIELDS, SageMakerFeatureGroupRelationshipAttributes, ) - return SageMakerFeatureGroup( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_feature_group_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_feature_group_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerFeatureGroup(**kwargs) def _sage_maker_feature_group_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sage_maker_model.py b/pyatlan_v9/model/assets/sage_maker_model.py index 6d07a55bb..6dc684312 100644 --- a/pyatlan_v9/model/assets/sage_maker_model.py +++ b/pyatlan_v9/model/assets/sage_maker_model.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .ai_related import RelatedAIModel from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -46,21 +53,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sage_maker_related import ( RelatedSageMakerModel, RelatedSageMakerModelDeployment, RelatedSageMakerModelGroup, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -918,33 +918,36 @@ def _sage_maker_model_from_nested(nested: SageMakerModelNested) -> SageMakerMode _SAGE_MAKER_MODEL_REL_FIELDS, SageMakerModelRelationshipAttributes, ) - return SageMakerModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_model_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerModel(**kwargs) def _sage_maker_model_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sage_maker_model_deployment.py b/pyatlan_v9/model/assets/sage_maker_model_deployment.py index 124ba1dbf..ada0aac2e 100644 --- a/pyatlan_v9/model/assets/sage_maker_model_deployment.py +++ b/pyatlan_v9/model/assets/sage_maker_model_deployment.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,17 +52,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sage_maker_related import RelatedSageMakerModel, RelatedSageMakerModelDeployment from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sage_maker_related import RelatedSageMakerModel, RelatedSageMakerModelDeployment # ============================================================================= # FLAT ASSET CLASS @@ -872,33 +872,36 @@ def _sage_maker_model_deployment_from_nested( _SAGE_MAKER_MODEL_DEPLOYMENT_REL_FIELDS, SageMakerModelDeploymentRelationshipAttributes, ) - return SageMakerModelDeployment( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_model_deployment_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_model_deployment_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerModelDeployment(**kwargs) def _sage_maker_model_deployment_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sage_maker_model_group.py b/pyatlan_v9/model/assets/sage_maker_model_group.py index cb6a12b65..28e5107b1 100644 --- a/pyatlan_v9/model/assets/sage_maker_model_group.py +++ b/pyatlan_v9/model/assets/sage_maker_model_group.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .ai_related import RelatedAIApplication, RelatedAIModelVersion from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -45,17 +52,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sage_maker_related import RelatedSageMakerModel, RelatedSageMakerModelGroup from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sage_maker_related import RelatedSageMakerModel, RelatedSageMakerModelGroup # ============================================================================= # FLAT ASSET CLASS @@ -852,33 +852,36 @@ def _sage_maker_model_group_from_nested( _SAGE_MAKER_MODEL_GROUP_REL_FIELDS, SageMakerModelGroupRelationshipAttributes, ) - return SageMakerModelGroup( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_model_group_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_model_group_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerModelGroup(**kwargs) def _sage_maker_model_group_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sage_maker_unified_studio.py b/pyatlan_v9/model/assets/sage_maker_unified_studio.py index 53b4f972f..c4fd02654 100644 --- a/pyatlan_v9/model/assets/sage_maker_unified_studio.py +++ b/pyatlan_v9/model/assets/sage_maker_unified_studio.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,17 +50,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sage_maker_unified_studio_related import RelatedSageMakerUnifiedStudio from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sage_maker_unified_studio_related import RelatedSageMakerUnifiedStudio # ============================================================================= # FLAT ASSET CLASS @@ -644,33 +644,36 @@ def _sage_maker_unified_studio_from_nested( _SAGE_MAKER_UNIFIED_STUDIO_REL_FIELDS, SageMakerUnifiedStudioRelationshipAttributes, ) - return SageMakerUnifiedStudio( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_unified_studio_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_unified_studio_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerUnifiedStudio(**kwargs) def _sage_maker_unified_studio_to_nested_bytes( @@ -691,10 +694,7 @@ def _sage_maker_unified_studio_from_nested_bytes( # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 SageMakerUnifiedStudio.SMUS_DOMAIN_NAME = KeywordField( "smusDomainName", "smusDomainName" diff --git a/pyatlan_v9/model/assets/sage_maker_unified_studio_asset.py b/pyatlan_v9/model/assets/sage_maker_unified_studio_asset.py index 8198c4307..e244c09d2 100644 --- a/pyatlan_v9/model/assets/sage_maker_unified_studio_asset.py +++ b/pyatlan_v9/model/assets/sage_maker_unified_studio_asset.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,20 +50,13 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sage_maker_unified_studio_related import ( RelatedSageMakerUnifiedStudioAsset, RelatedSageMakerUnifiedStudioAssetSchema, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -706,33 +706,36 @@ def _sage_maker_unified_studio_asset_from_nested( _SAGE_MAKER_UNIFIED_STUDIO_ASSET_REL_FIELDS, SageMakerUnifiedStudioAssetRelationshipAttributes, ) - return SageMakerUnifiedStudioAsset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_unified_studio_asset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_unified_studio_asset_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerUnifiedStudioAsset(**kwargs) def _sage_maker_unified_studio_asset_to_nested_bytes( @@ -755,10 +758,7 @@ def _sage_maker_unified_studio_asset_from_nested_bytes( # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 SageMakerUnifiedStudioAsset.SMUS_ASSET_SUMMARY = KeywordField( "smusAssetSummary", "smusAssetSummary" diff --git a/pyatlan_v9/model/assets/sage_maker_unified_studio_asset_schema.py b/pyatlan_v9/model/assets/sage_maker_unified_studio_asset_schema.py index 29c970898..aac13c7ae 100644 --- a/pyatlan_v9/model/assets/sage_maker_unified_studio_asset_schema.py +++ b/pyatlan_v9/model/assets/sage_maker_unified_studio_asset_schema.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,20 +51,13 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sage_maker_unified_studio_related import ( RelatedSageMakerUnifiedStudioAsset, RelatedSageMakerUnifiedStudioAssetSchema, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -706,33 +706,36 @@ def _sage_maker_unified_studio_asset_schema_from_nested( _SAGE_MAKER_UNIFIED_STUDIO_ASSET_SCHEMA_REL_FIELDS, SageMakerUnifiedStudioAssetSchemaRelationshipAttributes, ) - return SageMakerUnifiedStudioAssetSchema( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_unified_studio_asset_schema_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_unified_studio_asset_schema_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerUnifiedStudioAssetSchema(**kwargs) def _sage_maker_unified_studio_asset_schema_to_nested_bytes( @@ -758,10 +761,7 @@ def _sage_maker_unified_studio_asset_schema_from_nested_bytes( # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 SageMakerUnifiedStudioAssetSchema.SMUS_DATA_TYPE = KeywordField( "smusDataType", "smusDataType" diff --git a/pyatlan_v9/model/assets/sage_maker_unified_studio_project.py b/pyatlan_v9/model/assets/sage_maker_unified_studio_project.py index a14d92628..19afade5a 100644 --- a/pyatlan_v9/model/assets/sage_maker_unified_studio_project.py +++ b/pyatlan_v9/model/assets/sage_maker_unified_studio_project.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,21 +50,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sage_maker_unified_studio_related import ( RelatedSageMakerUnifiedStudioProject, RelatedSageMakerUnifiedStudioPublishedAsset, RelatedSageMakerUnifiedStudioSubscribedAsset, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -721,33 +721,36 @@ def _sage_maker_unified_studio_project_from_nested( _SAGE_MAKER_UNIFIED_STUDIO_PROJECT_REL_FIELDS, SageMakerUnifiedStudioProjectRelationshipAttributes, ) - return SageMakerUnifiedStudioProject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_unified_studio_project_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_unified_studio_project_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerUnifiedStudioProject(**kwargs) def _sage_maker_unified_studio_project_to_nested_bytes( @@ -770,10 +773,7 @@ def _sage_maker_unified_studio_project_from_nested_bytes( # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 SageMakerUnifiedStudioProject.SMUS_PROJECT_STATUS = KeywordField( "smusProjectStatus", "smusProjectStatus" diff --git a/pyatlan_v9/model/assets/sage_maker_unified_studio_published_asset.py b/pyatlan_v9/model/assets/sage_maker_unified_studio_published_asset.py index 5a134ce00..a5656d122 100644 --- a/pyatlan_v9/model/assets/sage_maker_unified_studio_published_asset.py +++ b/pyatlan_v9/model/assets/sage_maker_unified_studio_published_asset.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,22 +51,15 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sage_maker_unified_studio_related import ( RelatedSageMakerUnifiedStudioAssetSchema, RelatedSageMakerUnifiedStudioProject, RelatedSageMakerUnifiedStudioPublishedAsset, RelatedSageMakerUnifiedStudioSubscribedAsset, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -772,33 +772,36 @@ def _sage_maker_unified_studio_published_asset_from_nested( _SAGE_MAKER_UNIFIED_STUDIO_PUBLISHED_ASSET_REL_FIELDS, SageMakerUnifiedStudioPublishedAssetRelationshipAttributes, ) - return SageMakerUnifiedStudioPublishedAsset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_unified_studio_published_asset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_unified_studio_published_asset_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerUnifiedStudioPublishedAsset(**kwargs) def _sage_maker_unified_studio_published_asset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sage_maker_unified_studio_subscribed_asset.py b/pyatlan_v9/model/assets/sage_maker_unified_studio_subscribed_asset.py index 60ef690e4..dd8a09395 100644 --- a/pyatlan_v9/model/assets/sage_maker_unified_studio_subscribed_asset.py +++ b/pyatlan_v9/model/assets/sage_maker_unified_studio_subscribed_asset.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,22 +51,15 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sage_maker_unified_studio_related import ( RelatedSageMakerUnifiedStudioAssetSchema, RelatedSageMakerUnifiedStudioProject, RelatedSageMakerUnifiedStudioPublishedAsset, RelatedSageMakerUnifiedStudioSubscribedAsset, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -848,33 +848,36 @@ def _sage_maker_unified_studio_subscribed_asset_from_nested( _SAGE_MAKER_UNIFIED_STUDIO_SUBSCRIBED_ASSET_REL_FIELDS, SageMakerUnifiedStudioSubscribedAssetRelationshipAttributes, ) - return SageMakerUnifiedStudioSubscribedAsset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sage_maker_unified_studio_subscribed_asset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sage_maker_unified_studio_subscribed_asset_attrs(attrs)) + kwargs.update(merged_rels) + return SageMakerUnifiedStudioSubscribedAsset(**kwargs) def _sage_maker_unified_studio_subscribed_asset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/salesforce.py b/pyatlan_v9/model/assets/salesforce.py index 70aa2c32d..d0c8b50c0 100644 --- a/pyatlan_v9/model/assets/salesforce.py +++ b/pyatlan_v9/model/assets/salesforce.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,17 +50,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .salesforce_related import RelatedSalesforce from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .salesforce_related import RelatedSalesforce # ============================================================================= # FLAT ASSET CLASS @@ -590,33 +590,36 @@ def _salesforce_from_nested(nested: SalesforceNested) -> Salesforce: _SALESFORCE_REL_FIELDS, SalesforceRelationshipAttributes, ) - return Salesforce( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_salesforce_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_salesforce_attrs(attrs)) + kwargs.update(merged_rels) + return Salesforce(**kwargs) def _salesforce_to_nested_bytes(salesforce: Salesforce, serde: Serde) -> bytes: @@ -633,10 +636,7 @@ def _salesforce_from_nested_bytes(data: bytes, serde: Serde) -> Salesforce: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Salesforce.ORGANIZATION_QUALIFIED_NAME = KeywordField( "organizationQualifiedName", "organizationQualifiedName" diff --git a/pyatlan_v9/model/assets/salesforce_dashboard.py b/pyatlan_v9/model/assets/salesforce_dashboard.py index e5c1d4101..ee50223a5 100644 --- a/pyatlan_v9/model/assets/salesforce_dashboard.py +++ b/pyatlan_v9/model/assets/salesforce_dashboard.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .salesforce_related import ( RelatedSalesforceDashboard, RelatedSalesforceOrganization, RelatedSalesforceReport, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -666,33 +666,36 @@ def _salesforce_dashboard_from_nested( _SALESFORCE_DASHBOARD_REL_FIELDS, SalesforceDashboardRelationshipAttributes, ) - return SalesforceDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_salesforce_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_salesforce_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return SalesforceDashboard(**kwargs) def _salesforce_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/salesforce_field.py b/pyatlan_v9/model/assets/salesforce_field.py index 7e759cac0..a9fe84899 100644 --- a/pyatlan_v9/model/assets/salesforce_field.py +++ b/pyatlan_v9/model/assets/salesforce_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,17 +51,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .salesforce_related import RelatedSalesforceField, RelatedSalesforceObject from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .salesforce_related import RelatedSalesforceField, RelatedSalesforceObject # ============================================================================= # FLAT ASSET CLASS @@ -781,33 +781,36 @@ def _salesforce_field_from_nested(nested: SalesforceFieldNested) -> SalesforceFi _SALESFORCE_FIELD_REL_FIELDS, SalesforceFieldRelationshipAttributes, ) - return SalesforceField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_salesforce_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_salesforce_field_attrs(attrs)) + kwargs.update(merged_rels) + return SalesforceField(**kwargs) def _salesforce_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/salesforce_object.py b/pyatlan_v9/model/assets/salesforce_object.py index efdf88519..279e88a11 100644 --- a/pyatlan_v9/model/assets/salesforce_object.py +++ b/pyatlan_v9/model/assets/salesforce_object.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .salesforce_related import ( RelatedSalesforceField, RelatedSalesforceObject, RelatedSalesforceOrganization, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -681,33 +681,36 @@ def _salesforce_object_from_nested(nested: SalesforceObjectNested) -> Salesforce _SALESFORCE_OBJECT_REL_FIELDS, SalesforceObjectRelationshipAttributes, ) - return SalesforceObject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_salesforce_object_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_salesforce_object_attrs(attrs)) + kwargs.update(merged_rels) + return SalesforceObject(**kwargs) def _salesforce_object_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/salesforce_organization.py b/pyatlan_v9/model/assets/salesforce_organization.py index 33238bd1f..58cb30110 100644 --- a/pyatlan_v9/model/assets/salesforce_organization.py +++ b/pyatlan_v9/model/assets/salesforce_organization.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,22 +50,15 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .salesforce_related import ( RelatedSalesforceDashboard, RelatedSalesforceObject, RelatedSalesforceOrganization, RelatedSalesforceReport, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -646,33 +646,36 @@ def _salesforce_organization_from_nested( _SALESFORCE_ORGANIZATION_REL_FIELDS, SalesforceOrganizationRelationshipAttributes, ) - return SalesforceOrganization( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_salesforce_organization_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_salesforce_organization_attrs(attrs)) + kwargs.update(merged_rels) + return SalesforceOrganization(**kwargs) def _salesforce_organization_to_nested_bytes( @@ -693,10 +696,7 @@ def _salesforce_organization_from_nested_bytes( # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 SalesforceOrganization.SOURCE_ID = KeywordField("sourceId", "sourceId") SalesforceOrganization.ORGANIZATION_QUALIFIED_NAME = KeywordField( diff --git a/pyatlan_v9/model/assets/salesforce_report.py b/pyatlan_v9/model/assets/salesforce_report.py index e2a122dc8..da9d7b494 100644 --- a/pyatlan_v9/model/assets/salesforce_report.py +++ b/pyatlan_v9/model/assets/salesforce_report.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .salesforce_related import ( RelatedSalesforceDashboard, RelatedSalesforceOrganization, RelatedSalesforceReport, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -664,33 +664,36 @@ def _salesforce_report_from_nested(nested: SalesforceReportNested) -> Salesforce _SALESFORCE_REPORT_REL_FIELDS, SalesforceReportRelationshipAttributes, ) - return SalesforceReport( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_salesforce_report_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_salesforce_report_attrs(attrs)) + kwargs.update(merged_rels) + return SalesforceReport(**kwargs) def _salesforce_report_to_nested_bytes( @@ -709,10 +712,7 @@ def _salesforce_report_from_nested_bytes(data: bytes, serde: Serde) -> Salesforc # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 SalesforceReport.SOURCE_ID = KeywordField("sourceId", "sourceId") SalesforceReport.REPORT_TYPE = KeywordField("reportType", "reportType") diff --git a/pyatlan_v9/model/assets/sap.py b/pyatlan_v9/model/assets/sap.py index 4b6b4075c..adbcd979b 100644 --- a/pyatlan_v9/model/assets/sap.py +++ b/pyatlan_v9/model/assets/sap.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,17 +50,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sap_related import RelatedSAP from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sap_related import RelatedSAP # ============================================================================= # FLAT ASSET CLASS @@ -629,33 +629,36 @@ def _sap_from_nested(nested: SAPNested) -> SAP: _SAP_REL_FIELDS, SAPRelationshipAttributes, ) - return SAP( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_attrs(attrs)) + kwargs.update(merged_rels) + return SAP(**kwargs) def _sap_to_nested_bytes(sap: SAP, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sap_analytics_cloud.py b/pyatlan_v9/model/assets/sap_analytics_cloud.py index ed5df8b0b..73aab6dba 100644 --- a/pyatlan_v9/model/assets/sap_analytics_cloud.py +++ b/pyatlan_v9/model/assets/sap_analytics_cloud.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,17 +50,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sap_analytics_cloud_related import RelatedSapAnalyticsCloud from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sap_analytics_cloud_related import RelatedSapAnalyticsCloud # ============================================================================= # FLAT ASSET CLASS @@ -730,33 +730,36 @@ def _sap_analytics_cloud_from_nested( _SAP_ANALYTICS_CLOUD_REL_FIELDS, SapAnalyticsCloudRelationshipAttributes, ) - return SapAnalyticsCloud( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_analytics_cloud_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_analytics_cloud_attrs(attrs)) + kwargs.update(merged_rels) + return SapAnalyticsCloud(**kwargs) def _sap_analytics_cloud_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_analytics_cloud_column.py b/pyatlan_v9/model/assets/sap_analytics_cloud_column.py index c984033d6..873ac1c7e 100644 --- a/pyatlan_v9/model/assets/sap_analytics_cloud_column.py +++ b/pyatlan_v9/model/assets/sap_analytics_cloud_column.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -55,6 +62,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sap_analytics_cloud_related import ( + RelatedSapAnalyticsCloudColumn, + RelatedSapAnalyticsCloudModel, +) from .schema_registry_related import RelatedSchemaRegistrySubject from .snowflake_related import ( RelatedSnowflakeDynamicTable, @@ -76,17 +87,6 @@ RelatedTablePartition, RelatedView, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sap_analytics_cloud_related import ( - RelatedSapAnalyticsCloudColumn, - RelatedSapAnalyticsCloudModel, -) # ============================================================================= # FLAT ASSET CLASS @@ -2108,33 +2108,36 @@ def _sap_analytics_cloud_column_from_nested( _SAP_ANALYTICS_CLOUD_COLUMN_REL_FIELDS, SapAnalyticsCloudColumnRelationshipAttributes, ) - return SapAnalyticsCloudColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_analytics_cloud_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_analytics_cloud_column_attrs(attrs)) + kwargs.update(merged_rels) + return SapAnalyticsCloudColumn(**kwargs) def _sap_analytics_cloud_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_analytics_cloud_folder.py b/pyatlan_v9/model/assets/sap_analytics_cloud_folder.py index a1792808d..34b1b6b6a 100644 --- a/pyatlan_v9/model/assets/sap_analytics_cloud_folder.py +++ b/pyatlan_v9/model/assets/sap_analytics_cloud_folder.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sap_analytics_cloud_related import ( RelatedSapAnalyticsCloudFolder, RelatedSapAnalyticsCloudModel, RelatedSapAnalyticsCloudStory, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -797,33 +797,36 @@ def _sap_analytics_cloud_folder_from_nested( _SAP_ANALYTICS_CLOUD_FOLDER_REL_FIELDS, SapAnalyticsCloudFolderRelationshipAttributes, ) - return SapAnalyticsCloudFolder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_analytics_cloud_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_analytics_cloud_folder_attrs(attrs)) + kwargs.update(merged_rels) + return SapAnalyticsCloudFolder(**kwargs) def _sap_analytics_cloud_folder_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_analytics_cloud_model.py b/pyatlan_v9/model/assets/sap_analytics_cloud_model.py index 3ff144ca1..24e571374 100644 --- a/pyatlan_v9/model/assets/sap_analytics_cloud_model.py +++ b/pyatlan_v9/model/assets/sap_analytics_cloud_model.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sap_analytics_cloud_related import ( RelatedSapAnalyticsCloudColumn, RelatedSapAnalyticsCloudFolder, RelatedSapAnalyticsCloudModel, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -917,33 +917,36 @@ def _sap_analytics_cloud_model_from_nested( _SAP_ANALYTICS_CLOUD_MODEL_REL_FIELDS, SapAnalyticsCloudModelRelationshipAttributes, ) - return SapAnalyticsCloudModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_analytics_cloud_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_analytics_cloud_model_attrs(attrs)) + kwargs.update(merged_rels) + return SapAnalyticsCloudModel(**kwargs) def _sap_analytics_cloud_model_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_analytics_cloud_story.py b/pyatlan_v9/model/assets/sap_analytics_cloud_story.py index b3c4340cf..8ab593436 100644 --- a/pyatlan_v9/model/assets/sap_analytics_cloud_story.py +++ b/pyatlan_v9/model/assets/sap_analytics_cloud_story.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,20 +51,13 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sap_analytics_cloud_related import ( RelatedSapAnalyticsCloudFolder, RelatedSapAnalyticsCloudStory, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -782,33 +782,36 @@ def _sap_analytics_cloud_story_from_nested( _SAP_ANALYTICS_CLOUD_STORY_REL_FIELDS, SapAnalyticsCloudStoryRelationshipAttributes, ) - return SapAnalyticsCloudStory( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_analytics_cloud_story_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_analytics_cloud_story_attrs(attrs)) + kwargs.update(merged_rels) + return SapAnalyticsCloudStory(**kwargs) def _sap_analytics_cloud_story_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_column_process.py b/pyatlan_v9/model/assets/sap_column_process.py index d9d09ff23..442a83843 100644 --- a/pyatlan_v9/model/assets/sap_column_process.py +++ b/pyatlan_v9/model/assets/sap_column_process.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .adf_related import RelatedAdfActivity from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -52,19 +59,12 @@ from .process_related import RelatedColumnProcess, RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sap_related import RelatedSAPColumnProcess from .sapbw_related import RelatedSAPBWTransformation from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedFunction, RelatedProcedure -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sap_related import RelatedSAPColumnProcess # ============================================================================= # FLAT ASSET CLASS @@ -870,33 +870,36 @@ def _sap_column_process_from_nested(nested: SAPColumnProcessNested) -> SAPColumn _SAP_COLUMN_PROCESS_REL_FIELDS, SAPColumnProcessRelationshipAttributes, ) - return SAPColumnProcess( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_column_process_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_column_process_attrs(attrs)) + kwargs.update(merged_rels) + return SAPColumnProcess(**kwargs) def _sap_column_process_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_datasphere_replication_flow.py b/pyatlan_v9/model/assets/sap_datasphere_replication_flow.py index 0b8634919..e44ad964e 100644 --- a/pyatlan_v9/model/assets/sap_datasphere_replication_flow.py +++ b/pyatlan_v9/model/assets/sap_datasphere_replication_flow.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,18 +52,11 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sap_related import RelatedSapDatasphereReplicationFlow from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sap_related import RelatedSapDatasphereReplicationFlow # ============================================================================= # FLAT ASSET CLASS @@ -868,33 +868,36 @@ def _sap_datasphere_replication_flow_from_nested( _SAP_DATASPHERE_REPLICATION_FLOW_REL_FIELDS, SapDatasphereReplicationFlowRelationshipAttributes, ) - return SapDatasphereReplicationFlow( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_datasphere_replication_flow_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_datasphere_replication_flow_attrs(attrs)) + kwargs.update(merged_rels) + return SapDatasphereReplicationFlow(**kwargs) def _sap_datasphere_replication_flow_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_erp_abap_program.py b/pyatlan_v9/model/assets/sap_erp_abap_program.py index 3498f1635..3cea50973 100644 --- a/pyatlan_v9/model/assets/sap_erp_abap_program.py +++ b/pyatlan_v9/model/assets/sap_erp_abap_program.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,22 +50,15 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sap_related import ( RelatedSapErpAbapProgram, RelatedSapErpComponent, RelatedSapErpFunctionModule, RelatedSapErpTransactionCode, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -695,33 +695,36 @@ def _sap_erp_abap_program_from_nested( _SAP_ERP_ABAP_PROGRAM_REL_FIELDS, SapErpAbapProgramRelationshipAttributes, ) - return SapErpAbapProgram( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_erp_abap_program_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_erp_abap_program_attrs(attrs)) + kwargs.update(merged_rels) + return SapErpAbapProgram(**kwargs) def _sap_erp_abap_program_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_erp_cds_view.py b/pyatlan_v9/model/assets/sap_erp_cds_view.py index c49f49c45..e202cb3fa 100644 --- a/pyatlan_v9/model/assets/sap_erp_cds_view.py +++ b/pyatlan_v9/model/assets/sap_erp_cds_view.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,21 +50,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sap_related import ( RelatedSapErpCdsView, RelatedSapErpColumn, RelatedSapErpComponent, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -690,33 +690,36 @@ def _sap_erp_cds_view_from_nested(nested: SapErpCdsViewNested) -> SapErpCdsView: _SAP_ERP_CDS_VIEW_REL_FIELDS, SapErpCdsViewRelationshipAttributes, ) - return SapErpCdsView( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_erp_cds_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_erp_cds_view_attrs(attrs)) + kwargs.update(merged_rels) + return SapErpCdsView(**kwargs) def _sap_erp_cds_view_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_erp_column.py b/pyatlan_v9/model/assets/sap_erp_column.py index d31a4b439..195da0da4 100644 --- a/pyatlan_v9/model/assets/sap_erp_column.py +++ b/pyatlan_v9/model/assets/sap_erp_column.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -51,6 +58,12 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sap_related import ( + RelatedSapErpCdsView, + RelatedSapErpColumn, + RelatedSapErpTable, + RelatedSapErpView, +) from .schema_registry_related import RelatedSchemaRegistrySubject from .snowflake_related import RelatedSnowflakeSemanticLogicalTable from .soda_related import RelatedSodaCheck @@ -59,19 +72,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sap_related import ( - RelatedSapErpCdsView, - RelatedSapErpColumn, - RelatedSapErpTable, - RelatedSapErpView, -) # ============================================================================= # FLAT ASSET CLASS @@ -1253,33 +1253,36 @@ def _sap_erp_column_from_nested(nested: SapErpColumnNested) -> SapErpColumn: _SAP_ERP_COLUMN_REL_FIELDS, SapErpColumnRelationshipAttributes, ) - return SapErpColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_erp_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_erp_column_attrs(attrs)) + kwargs.update(merged_rels) + return SapErpColumn(**kwargs) def _sap_erp_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_erp_component.py b/pyatlan_v9/model/assets/sap_erp_component.py index 8e1101081..2ca20632e 100644 --- a/pyatlan_v9/model/assets/sap_erp_component.py +++ b/pyatlan_v9/model/assets/sap_erp_component.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,16 +50,6 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sap_related import ( RelatedSapErpAbapProgram, RelatedSapErpCdsView, @@ -63,6 +60,9 @@ RelatedSapErpTransactionCode, RelatedSapErpView, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -740,33 +740,36 @@ def _sap_erp_component_from_nested(nested: SapErpComponentNested) -> SapErpCompo _SAP_ERP_COMPONENT_REL_FIELDS, SapErpComponentRelationshipAttributes, ) - return SapErpComponent( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_erp_component_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_erp_component_attrs(attrs)) + kwargs.update(merged_rels) + return SapErpComponent(**kwargs) def _sap_erp_component_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_erp_fiori_app.py b/pyatlan_v9/model/assets/sap_erp_fiori_app.py index 177c4335a..29d18d535 100644 --- a/pyatlan_v9/model/assets/sap_erp_fiori_app.py +++ b/pyatlan_v9/model/assets/sap_erp_fiori_app.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,17 +51,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sap_related import RelatedSapErpComponent, RelatedSapErpFioriApp from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sap_related import RelatedSapErpComponent, RelatedSapErpFioriApp # ============================================================================= # FLAT ASSET CLASS @@ -737,33 +737,36 @@ def _sap_erp_fiori_app_from_nested(nested: SapErpFioriAppNested) -> SapErpFioriA _SAP_ERP_FIORI_APP_REL_FIELDS, SapErpFioriAppRelationshipAttributes, ) - return SapErpFioriApp( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_erp_fiori_app_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_erp_fiori_app_attrs(attrs)) + kwargs.update(merged_rels) + return SapErpFioriApp(**kwargs) def _sap_erp_fiori_app_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_erp_function_module.py b/pyatlan_v9/model/assets/sap_erp_function_module.py index d5ad93b7c..a9ac8b55b 100644 --- a/pyatlan_v9/model/assets/sap_erp_function_module.py +++ b/pyatlan_v9/model/assets/sap_erp_function_module.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,21 +50,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sap_related import ( RelatedSapErpAbapProgram, RelatedSapErpComponent, RelatedSapErpFunctionModule, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -766,33 +766,36 @@ def _sap_erp_function_module_from_nested( _SAP_ERP_FUNCTION_MODULE_REL_FIELDS, SapErpFunctionModuleRelationshipAttributes, ) - return SapErpFunctionModule( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_erp_function_module_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_erp_function_module_attrs(attrs)) + kwargs.update(merged_rels) + return SapErpFunctionModule(**kwargs) def _sap_erp_function_module_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_erp_table.py b/pyatlan_v9/model/assets/sap_erp_table.py index bfb27d693..c734264b8 100644 --- a/pyatlan_v9/model/assets/sap_erp_table.py +++ b/pyatlan_v9/model/assets/sap_erp_table.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,17 +50,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sap_related import RelatedSapErpColumn, RelatedSapErpComponent, RelatedSapErpTable from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sap_related import RelatedSapErpColumn, RelatedSapErpComponent, RelatedSapErpTable # ============================================================================= # FLAT ASSET CLASS @@ -679,33 +679,36 @@ def _sap_erp_table_from_nested(nested: SapErpTableNested) -> SapErpTable: _SAP_ERP_TABLE_REL_FIELDS, SapErpTableRelationshipAttributes, ) - return SapErpTable( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_erp_table_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_erp_table_attrs(attrs)) + kwargs.update(merged_rels) + return SapErpTable(**kwargs) def _sap_erp_table_to_nested_bytes(sap_erp_table: SapErpTable, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sap_erp_transaction_code.py b/pyatlan_v9/model/assets/sap_erp_transaction_code.py index 70cdd25c0..ff63c1258 100644 --- a/pyatlan_v9/model/assets/sap_erp_transaction_code.py +++ b/pyatlan_v9/model/assets/sap_erp_transaction_code.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,21 +50,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sap_related import ( RelatedSapErpAbapProgram, RelatedSapErpComponent, RelatedSapErpTransactionCode, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -671,33 +671,36 @@ def _sap_erp_transaction_code_from_nested( _SAP_ERP_TRANSACTION_CODE_REL_FIELDS, SapErpTransactionCodeRelationshipAttributes, ) - return SapErpTransactionCode( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_erp_transaction_code_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_erp_transaction_code_attrs(attrs)) + kwargs.update(merged_rels) + return SapErpTransactionCode(**kwargs) def _sap_erp_transaction_code_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sap_erp_view.py b/pyatlan_v9/model/assets/sap_erp_view.py index 11170acef..efe97f49b 100644 --- a/pyatlan_v9/model/assets/sap_erp_view.py +++ b/pyatlan_v9/model/assets/sap_erp_view.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,17 +50,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sap_related import RelatedSapErpColumn, RelatedSapErpComponent, RelatedSapErpView from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sap_related import RelatedSapErpColumn, RelatedSapErpComponent, RelatedSapErpView # ============================================================================= # FLAT ASSET CLASS @@ -669,33 +669,36 @@ def _sap_erp_view_from_nested(nested: SapErpViewNested) -> SapErpView: _SAP_ERP_VIEW_REL_FIELDS, SapErpViewRelationshipAttributes, ) - return SapErpView( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_erp_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_erp_view_attrs(attrs)) + kwargs.update(merged_rels) + return SapErpView(**kwargs) def _sap_erp_view_to_nested_bytes(sap_erp_view: SapErpView, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sap_process.py b/pyatlan_v9/model/assets/sap_process.py index 402958228..1d6d8b0be 100644 --- a/pyatlan_v9/model/assets/sap_process.py +++ b/pyatlan_v9/model/assets/sap_process.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .adf_related import RelatedAdfActivity from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -52,19 +59,12 @@ from .process_related import RelatedColumnProcess, RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sap_related import RelatedSAPProcess from .sapbw_related import RelatedSAPBWDTP from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedFunction, RelatedProcedure -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sap_related import RelatedSAPProcess # ============================================================================= # FLAT ASSET CLASS @@ -846,33 +846,36 @@ def _sap_process_from_nested(nested: SAPProcessNested) -> SAPProcess: _SAP_PROCESS_REL_FIELDS, SAPProcessRelationshipAttributes, ) - return SAPProcess( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sap_process_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sap_process_attrs(attrs)) + kwargs.update(merged_rels) + return SAPProcess(**kwargs) def _sap_process_to_nested_bytes(sap_process: SAPProcess, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sapbw.py b/pyatlan_v9/model/assets/sapbw.py index df3d3002b..3ff99eedd 100644 --- a/pyatlan_v9/model/assets/sapbw.py +++ b/pyatlan_v9/model/assets/sapbw.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,17 +50,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sapbw_related import RelatedSAPBW from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sapbw_related import RelatedSAPBW # ============================================================================= # FLAT ASSET CLASS @@ -689,33 +689,36 @@ def _sapbw_from_nested(nested: SAPBWNested) -> SAPBW: _SAPBW_REL_FIELDS, SAPBWRelationshipAttributes, ) - return SAPBW( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBW(**kwargs) def _sapbw_to_nested_bytes(sapbw: SAPBW, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sapbw_composite_provider.py b/pyatlan_v9/model/assets/sapbw_composite_provider.py index f4ad0a405..6ef855c23 100644 --- a/pyatlan_v9/model/assets/sapbw_composite_provider.py +++ b/pyatlan_v9/model/assets/sapbw_composite_provider.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,22 +51,15 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWADSO, RelatedSAPBWCompositeProvider, RelatedSAPBWCompositeProviderField, RelatedSAPBWInfoArea, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -766,33 +766,36 @@ def _sapbw_composite_provider_from_nested( _SAPBW_COMPOSITE_PROVIDER_REL_FIELDS, SAPBWCompositeProviderRelationshipAttributes, ) - return SAPBWCompositeProvider( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_composite_provider_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_composite_provider_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWCompositeProvider(**kwargs) def _sapbw_composite_provider_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbw_composite_provider_field.py b/pyatlan_v9/model/assets/sapbw_composite_provider_field.py index 0a380408c..edd1d216a 100644 --- a/pyatlan_v9/model/assets/sapbw_composite_provider_field.py +++ b/pyatlan_v9/model/assets/sapbw_composite_provider_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWCompositeProvider, RelatedSAPBWCompositeProviderField, RelatedSAPBWInfoObject, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -750,33 +750,36 @@ def _sapbw_composite_provider_field_from_nested( _SAPBW_COMPOSITE_PROVIDER_FIELD_REL_FIELDS, SAPBWCompositeProviderFieldRelationshipAttributes, ) - return SAPBWCompositeProviderField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_composite_provider_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_composite_provider_field_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWCompositeProviderField(**kwargs) def _sapbw_composite_provider_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbw_data_source.py b/pyatlan_v9/model/assets/sapbw_data_source.py index 143197ca6..d89e8757b 100644 --- a/pyatlan_v9/model/assets/sapbw_data_source.py +++ b/pyatlan_v9/model/assets/sapbw_data_source.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,17 +50,10 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .sapbw_related import RelatedSAPBWDataSource, RelatedSAPBWDataSourceField from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sapbw_related import RelatedSAPBWDataSource, RelatedSAPBWDataSourceField # ============================================================================= # FLAT ASSET CLASS @@ -742,33 +742,36 @@ def _sapbw_data_source_from_nested(nested: SAPBWDataSourceNested) -> SAPBWDataSo _SAPBW_DATA_SOURCE_REL_FIELDS, SAPBWDataSourceRelationshipAttributes, ) - return SAPBWDataSource( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_data_source_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_data_source_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWDataSource(**kwargs) def _sapbw_data_source_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbw_data_source_field.py b/pyatlan_v9/model/assets/sapbw_data_source_field.py index 767c71c1a..242fbea9c 100644 --- a/pyatlan_v9/model/assets/sapbw_data_source_field.py +++ b/pyatlan_v9/model/assets/sapbw_data_source_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWDataSource, RelatedSAPBWDataSourceField, RelatedSAPBWInfoObject, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -740,33 +740,36 @@ def _sapbw_data_source_field_from_nested( _SAPBW_DATA_SOURCE_FIELD_REL_FIELDS, SAPBWDataSourceFieldRelationshipAttributes, ) - return SAPBWDataSourceField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_data_source_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_data_source_field_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWDataSourceField(**kwargs) def _sapbw_data_source_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbw_info_area.py b/pyatlan_v9/model/assets/sapbw_info_area.py index 9cf5e4ecd..fc42a5181 100644 --- a/pyatlan_v9/model/assets/sapbw_info_area.py +++ b/pyatlan_v9/model/assets/sapbw_info_area.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,16 +51,6 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWADSO, RelatedSAPBWCompositeProvider, @@ -62,6 +59,9 @@ RelatedSAPBWInfoSource, RelatedSAPBWQuery, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -777,33 +777,36 @@ def _sapbw_info_area_from_nested(nested: SAPBWInfoAreaNested) -> SAPBWInfoArea: _SAPBW_INFO_AREA_REL_FIELDS, SAPBWInfoAreaRelationshipAttributes, ) - return SAPBWInfoArea( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_info_area_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_info_area_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWInfoArea(**kwargs) def _sapbw_info_area_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbw_info_object.py b/pyatlan_v9/model/assets/sapbw_info_object.py index 01b95ae74..7a7698c48 100644 --- a/pyatlan_v9/model/assets/sapbw_info_object.py +++ b/pyatlan_v9/model/assets/sapbw_info_object.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,16 +51,6 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWADSOField, RelatedSAPBWCompositeProviderField, @@ -63,6 +60,9 @@ RelatedSAPBWInfoSourceField, RelatedSAPBWQueryElement, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -823,33 +823,36 @@ def _sapbw_info_object_from_nested(nested: SAPBWInfoObjectNested) -> SAPBWInfoOb _SAPBW_INFO_OBJECT_REL_FIELDS, SAPBWInfoObjectRelationshipAttributes, ) - return SAPBWInfoObject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_info_object_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_info_object_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWInfoObject(**kwargs) def _sapbw_info_object_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbw_info_source.py b/pyatlan_v9/model/assets/sapbw_info_source.py index 1c86c8f87..0e56d1bfe 100644 --- a/pyatlan_v9/model/assets/sapbw_info_source.py +++ b/pyatlan_v9/model/assets/sapbw_info_source.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWInfoArea, RelatedSAPBWInfoSource, RelatedSAPBWInfoSourceField, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -742,33 +742,36 @@ def _sapbw_info_source_from_nested(nested: SAPBWInfoSourceNested) -> SAPBWInfoSo _SAPBW_INFO_SOURCE_REL_FIELDS, SAPBWInfoSourceRelationshipAttributes, ) - return SAPBWInfoSource( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_info_source_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_info_source_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWInfoSource(**kwargs) def _sapbw_info_source_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbw_info_source_field.py b/pyatlan_v9/model/assets/sapbw_info_source_field.py index a92ff1a09..4c9fd6e4a 100644 --- a/pyatlan_v9/model/assets/sapbw_info_source_field.py +++ b/pyatlan_v9/model/assets/sapbw_info_source_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWInfoObject, RelatedSAPBWInfoSource, RelatedSAPBWInfoSourceField, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -751,33 +751,36 @@ def _sapbw_info_source_field_from_nested( _SAPBW_INFO_SOURCE_FIELD_REL_FIELDS, SAPBWInfoSourceFieldRelationshipAttributes, ) - return SAPBWInfoSourceField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_info_source_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_info_source_field_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWInfoSourceField(**kwargs) def _sapbw_info_source_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbw_query.py b/pyatlan_v9/model/assets/sapbw_query.py index 5d21a3e8d..ace661f60 100644 --- a/pyatlan_v9/model/assets/sapbw_query.py +++ b/pyatlan_v9/model/assets/sapbw_query.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWInfoArea, RelatedSAPBWQuery, RelatedSAPBWQueryElement, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -739,33 +739,36 @@ def _sapbw_query_from_nested(nested: SAPBWQueryNested) -> SAPBWQuery: _SAPBW_QUERY_REL_FIELDS, SAPBWQueryRelationshipAttributes, ) - return SAPBWQuery( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_query_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_query_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWQuery(**kwargs) def _sapbw_query_to_nested_bytes(sapbw_query: SAPBWQuery, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sapbw_query_element.py b/pyatlan_v9/model/assets/sapbw_query_element.py index d6fcd766c..3acadbd9a 100644 --- a/pyatlan_v9/model/assets/sapbw_query_element.py +++ b/pyatlan_v9/model/assets/sapbw_query_element.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWInfoObject, RelatedSAPBWQuery, RelatedSAPBWQueryElement, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -740,33 +740,36 @@ def _sapbw_query_element_from_nested( _SAPBW_QUERY_ELEMENT_REL_FIELDS, SAPBWQueryElementRelationshipAttributes, ) - return SAPBWQueryElement( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_query_element_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_query_element_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWQueryElement(**kwargs) def _sapbw_query_element_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbw_transformation.py b/pyatlan_v9/model/assets/sapbw_transformation.py index 56755d812..1c6ecdc16 100644 --- a/pyatlan_v9/model/assets/sapbw_transformation.py +++ b/pyatlan_v9/model/assets/sapbw_transformation.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,17 +51,10 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .sap_related import RelatedSAPColumnProcess +from .sapbw_related import RelatedSAPBWDTP, RelatedSAPBWTransformation from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sapbw_related import RelatedSAPBWDTP, RelatedSAPBWTransformation # ============================================================================= # FLAT ASSET CLASS @@ -735,33 +735,36 @@ def _sapbw_transformation_from_nested( _SAPBW_TRANSFORMATION_REL_FIELDS, SAPBWTransformationRelationshipAttributes, ) - return SAPBWTransformation( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbw_transformation_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbw_transformation_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWTransformation(**kwargs) def _sapbw_transformation_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbwadso.py b/pyatlan_v9/model/assets/sapbwadso.py index 9e516bc61..2f505c0b2 100644 --- a/pyatlan_v9/model/assets/sapbwadso.py +++ b/pyatlan_v9/model/assets/sapbwadso.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,22 +51,15 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWADSO, RelatedSAPBWADSOField, RelatedSAPBWCompositeProvider, RelatedSAPBWInfoArea, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -757,33 +757,36 @@ def _sapbwadso_from_nested(nested: SAPBWADSONested) -> SAPBWADSO: _SAPBWADSO_REL_FIELDS, SAPBWADSORelationshipAttributes, ) - return SAPBWADSO( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbwadso_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbwadso_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWADSO(**kwargs) def _sapbwadso_to_nested_bytes(sapbwadso: SAPBWADSO, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sapbwadso_field.py b/pyatlan_v9/model/assets/sapbwadso_field.py index 0b2adad0e..8e065bfd9 100644 --- a/pyatlan_v9/model/assets/sapbwadso_field.py +++ b/pyatlan_v9/model/assets/sapbwadso_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sapbw_related import ( RelatedSAPBWADSO, RelatedSAPBWADSOField, RelatedSAPBWInfoObject, ) +from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -734,33 +734,36 @@ def _sapbwadso_field_from_nested(nested: SAPBWADSOFieldNested) -> SAPBWADSOField _SAPBWADSO_FIELD_REL_FIELDS, SAPBWADSOFieldRelationshipAttributes, ) - return SAPBWADSOField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbwadso_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbwadso_field_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWADSOField(**kwargs) def _sapbwadso_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sapbwdtp.py b/pyatlan_v9/model/assets/sapbwdtp.py index ce6c95477..7b9cc1afb 100644 --- a/pyatlan_v9/model/assets/sapbwdtp.py +++ b/pyatlan_v9/model/assets/sapbwdtp.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,17 +51,10 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .sap_related import RelatedSAPProcess +from .sapbw_related import RelatedSAPBWDTP, RelatedSAPBWTransformation from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sapbw_related import RelatedSAPBWDTP, RelatedSAPBWTransformation # ============================================================================= # FLAT ASSET CLASS @@ -712,33 +712,36 @@ def _sapbwdtp_from_nested(nested: SAPBWDTPNested) -> SAPBWDTP: _SAPBWDTP_REL_FIELDS, SAPBWDTPRelationshipAttributes, ) - return SAPBWDTP( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sapbwdtp_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sapbwdtp_attrs(attrs)) + kwargs.update(merged_rels) + return SAPBWDTP(**kwargs) def _sapbwdtp_to_nested_bytes(sapbwdtp: SAPBWDTP, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/schema.py b/pyatlan_v9/model/assets/schema.py index 1b947e974..b17420424 100644 --- a/pyatlan_v9/model/assets/schema.py +++ b/pyatlan_v9/model/assets/schema.py @@ -20,6 +20,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -71,14 +79,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .sql_related import ( RelatedCalculationView, RelatedDatabase, @@ -1336,33 +1336,36 @@ def _schema__from_nested(nested: SchemaNested) -> Schema: _SCHEMA_REL_FIELDS, SchemaRelationshipAttributes, ) - return Schema( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_schema__attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_schema__attrs(attrs)) + kwargs.update(merged_rels) + return Schema(**kwargs) def _schema__to_nested_bytes(schema_: Schema, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/schema_registry.py b/pyatlan_v9/model/assets/schema_registry.py index aaf92a2e3..25f156771 100644 --- a/pyatlan_v9/model/assets/schema_registry.py +++ b/pyatlan_v9/model/assets/schema_registry.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -43,16 +50,9 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme +from .schema_registry_related import RelatedSchemaRegistry, RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .schema_registry_related import RelatedSchemaRegistry, RelatedSchemaRegistrySubject # ============================================================================= # FLAT ASSET CLASS @@ -597,33 +597,36 @@ def _schema_registry_from_nested(nested: SchemaRegistryNested) -> SchemaRegistry _SCHEMA_REGISTRY_REL_FIELDS, SchemaRegistryRelationshipAttributes, ) - return SchemaRegistry( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_schema_registry_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_schema_registry_attrs(attrs)) + kwargs.update(merged_rels) + return SchemaRegistry(**kwargs) def _schema_registry_to_nested_bytes( @@ -642,10 +645,7 @@ def _schema_registry_from_nested_bytes(data: bytes, serde: Serde) -> SchemaRegis # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 SchemaRegistry.SCHEMA_REGISTRY_SCHEMA_TYPE = KeywordField( "schemaRegistrySchemaType", "schemaRegistrySchemaType" diff --git a/pyatlan_v9/model/assets/schema_registry_subject.py b/pyatlan_v9/model/assets/schema_registry_subject.py index e0811b865..15a9fa161 100644 --- a/pyatlan_v9/model/assets/schema_registry_subject.py +++ b/pyatlan_v9/model/assets/schema_registry_subject.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,19 +51,12 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .schema_registry_related import ( RelatedSchemaRegistrySubject, RelatedSchemaRegistryVersion, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -713,33 +713,36 @@ def _schema_registry_subject_from_nested( _SCHEMA_REGISTRY_SUBJECT_REL_FIELDS, SchemaRegistrySubjectRelationshipAttributes, ) - return SchemaRegistrySubject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_schema_registry_subject_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_schema_registry_subject_attrs(attrs)) + kwargs.update(merged_rels) + return SchemaRegistrySubject(**kwargs) def _schema_registry_subject_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/schema_registry_version.py b/pyatlan_v9/model/assets/schema_registry_version.py index 2c23a7cf2..e53e71d10 100644 --- a/pyatlan_v9/model/assets/schema_registry_version.py +++ b/pyatlan_v9/model/assets/schema_registry_version.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,19 +51,12 @@ from .process_related import RelatedProcess from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .schema_registry_related import ( RelatedSchemaRegistrySubject, RelatedSchemaRegistryVersion, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -683,33 +683,36 @@ def _schema_registry_version_from_nested( _SCHEMA_REGISTRY_VERSION_REL_FIELDS, SchemaRegistryVersionRelationshipAttributes, ) - return SchemaRegistryVersion( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_schema_registry_version_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_schema_registry_version_attrs(attrs)) + kwargs.update(merged_rels) + return SchemaRegistryVersion(**kwargs) def _schema_registry_version_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/semantic.py b/pyatlan_v9/model/assets/semantic.py index 1c2b51531..a67da7f2f 100644 --- a/pyatlan_v9/model/assets/semantic.py +++ b/pyatlan_v9/model/assets/semantic.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,16 +51,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .semantic_related import RelatedSemantic from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .semantic_related import RelatedSemantic # ============================================================================= # FLAT ASSET CLASS @@ -572,33 +572,36 @@ def _semantic_from_nested(nested: SemanticNested) -> Semantic: _SEMANTIC_REL_FIELDS, SemanticRelationshipAttributes, ) - return Semantic( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_semantic_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_semantic_attrs(attrs)) + kwargs.update(merged_rels) + return Semantic(**kwargs) def _semantic_to_nested_bytes(semantic: Semantic, serde: Serde) -> bytes: @@ -615,10 +618,7 @@ def _semantic_from_nested_bytes(data: bytes, serde: Serde) -> Semantic: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Semantic.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") Semantic.INPUT_TO_AIRFLOW_TASKS = RelationField("inputToAirflowTasks") diff --git a/pyatlan_v9/model/assets/semantic_dimension.py b/pyatlan_v9/model/assets/semantic_dimension.py index afde57288..67c18d2b7 100644 --- a/pyatlan_v9/model/assets/semantic_dimension.py +++ b/pyatlan_v9/model/assets/semantic_dimension.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,16 +52,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .semantic_related import RelatedSemanticDimension, RelatedSemanticModel from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .semantic_related import RelatedSemanticDimension, RelatedSemanticModel # ============================================================================= # FLAT ASSET CLASS @@ -670,33 +670,36 @@ def _semantic_dimension_from_nested( _SEMANTIC_DIMENSION_REL_FIELDS, SemanticDimensionRelationshipAttributes, ) - return SemanticDimension( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_semantic_dimension_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_semantic_dimension_attrs(attrs)) + kwargs.update(merged_rels) + return SemanticDimension(**kwargs) def _semantic_dimension_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/semantic_entity.py b/pyatlan_v9/model/assets/semantic_entity.py index 8b056f443..f61647bd5 100644 --- a/pyatlan_v9/model/assets/semantic_entity.py +++ b/pyatlan_v9/model/assets/semantic_entity.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,16 +52,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .semantic_related import RelatedSemanticEntity, RelatedSemanticModel from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .semantic_related import RelatedSemanticEntity, RelatedSemanticModel # ============================================================================= # FLAT ASSET CLASS @@ -664,33 +664,36 @@ def _semantic_entity_from_nested(nested: SemanticEntityNested) -> SemanticEntity _SEMANTIC_ENTITY_REL_FIELDS, SemanticEntityRelationshipAttributes, ) - return SemanticEntity( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_semantic_entity_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_semantic_entity_attrs(attrs)) + kwargs.update(merged_rels) + return SemanticEntity(**kwargs) def _semantic_entity_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/semantic_field.py b/pyatlan_v9/model/assets/semantic_field.py index 1b2107be5..0dac60ab6 100644 --- a/pyatlan_v9/model/assets/semantic_field.py +++ b/pyatlan_v9/model/assets/semantic_field.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,16 +51,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .semantic_related import RelatedSemanticField from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .semantic_related import RelatedSemanticField # ============================================================================= # FLAT ASSET CLASS @@ -641,33 +641,36 @@ def _semantic_field_from_nested(nested: SemanticFieldNested) -> SemanticField: _SEMANTIC_FIELD_REL_FIELDS, SemanticFieldRelationshipAttributes, ) - return SemanticField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_semantic_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_semantic_field_attrs(attrs)) + kwargs.update(merged_rels) + return SemanticField(**kwargs) def _semantic_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/semantic_measure.py b/pyatlan_v9/model/assets/semantic_measure.py index 82d731bde..2dad58ae3 100644 --- a/pyatlan_v9/model/assets/semantic_measure.py +++ b/pyatlan_v9/model/assets/semantic_measure.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,16 +52,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .semantic_related import RelatedSemanticMeasure, RelatedSemanticModel from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .semantic_related import RelatedSemanticMeasure, RelatedSemanticModel # ============================================================================= # FLAT ASSET CLASS @@ -668,33 +668,36 @@ def _semantic_measure_from_nested(nested: SemanticMeasureNested) -> SemanticMeas _SEMANTIC_MEASURE_REL_FIELDS, SemanticMeasureRelationshipAttributes, ) - return SemanticMeasure( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_semantic_measure_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_semantic_measure_attrs(attrs)) + kwargs.update(merged_rels) + return SemanticMeasure(**kwargs) def _semantic_measure_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/semantic_model.py b/pyatlan_v9/model/assets/semantic_model.py index ac5db3218..7a9d54479 100644 --- a/pyatlan_v9/model/assets/semantic_model.py +++ b/pyatlan_v9/model/assets/semantic_model.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,21 +51,14 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .semantic_related import ( RelatedSemanticDimension, RelatedSemanticEntity, RelatedSemanticMeasure, RelatedSemanticModel, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -607,33 +607,36 @@ def _semantic_model_from_nested(nested: SemanticModelNested) -> SemanticModel: _SEMANTIC_MODEL_REL_FIELDS, SemanticModelRelationshipAttributes, ) - return SemanticModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_semantic_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_semantic_model_attrs(attrs)) + kwargs.update(merged_rels) + return SemanticModel(**kwargs) def _semantic_model_to_nested_bytes( @@ -652,10 +655,7 @@ def _semantic_model_from_nested_bytes(data: bytes, serde: Serde) -> SemanticMode # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 SemanticModel.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/sigma.py b/pyatlan_v9/model/assets/sigma.py index 64599db1d..21914d042 100644 --- a/pyatlan_v9/model/assets/sigma.py +++ b/pyatlan_v9/model/assets/sigma.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,16 +51,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .sigma_related import RelatedSigma from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sigma_related import RelatedSigma # ============================================================================= # FLAT ASSET CLASS @@ -626,33 +626,36 @@ def _sigma_from_nested(nested: SigmaNested) -> Sigma: _SIGMA_REL_FIELDS, SigmaRelationshipAttributes, ) - return Sigma( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sigma_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sigma_attrs(attrs)) + kwargs.update(merged_rels) + return Sigma(**kwargs) def _sigma_to_nested_bytes(sigma: Sigma, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sigma_data_element.py b/pyatlan_v9/model/assets/sigma_data_element.py index a3217a98a..4027390d5 100644 --- a/pyatlan_v9/model/assets/sigma_data_element.py +++ b/pyatlan_v9/model/assets/sigma_data_element.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,20 +52,13 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sigma_related import ( RelatedSigmaDataElement, RelatedSigmaDataElementField, RelatedSigmaPage, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -714,33 +714,36 @@ def _sigma_data_element_from_nested(nested: SigmaDataElementNested) -> SigmaData _SIGMA_DATA_ELEMENT_REL_FIELDS, SigmaDataElementRelationshipAttributes, ) - return SigmaDataElement( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sigma_data_element_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sigma_data_element_attrs(attrs)) + kwargs.update(merged_rels) + return SigmaDataElement(**kwargs) def _sigma_data_element_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sigma_data_element_field.py b/pyatlan_v9/model/assets/sigma_data_element_field.py index 4153bc63f..57ee9beeb 100644 --- a/pyatlan_v9/model/assets/sigma_data_element_field.py +++ b/pyatlan_v9/model/assets/sigma_data_element_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,16 +52,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .sigma_related import RelatedSigmaDataElement, RelatedSigmaDataElementField from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sigma_related import RelatedSigmaDataElement, RelatedSigmaDataElementField # ============================================================================= # FLAT ASSET CLASS @@ -701,33 +701,36 @@ def _sigma_data_element_field_from_nested( _SIGMA_DATA_ELEMENT_FIELD_REL_FIELDS, SigmaDataElementFieldRelationshipAttributes, ) - return SigmaDataElementField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sigma_data_element_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sigma_data_element_field_attrs(attrs)) + kwargs.update(merged_rels) + return SigmaDataElementField(**kwargs) def _sigma_data_element_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sigma_data_model.py b/pyatlan_v9/model/assets/sigma_data_model.py index b702f1da8..ac2a2cda0 100644 --- a/pyatlan_v9/model/assets/sigma_data_model.py +++ b/pyatlan_v9/model/assets/sigma_data_model.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,16 +51,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .sigma_related import RelatedSigmaDataModel, RelatedSigmaDataModelColumn from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sigma_related import RelatedSigmaDataModel, RelatedSigmaDataModelColumn # ============================================================================= # FLAT ASSET CLASS @@ -719,33 +719,36 @@ def _sigma_data_model_from_nested(nested: SigmaDataModelNested) -> SigmaDataMode _SIGMA_DATA_MODEL_REL_FIELDS, SigmaDataModelRelationshipAttributes, ) - return SigmaDataModel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sigma_data_model_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sigma_data_model_attrs(attrs)) + kwargs.update(merged_rels) + return SigmaDataModel(**kwargs) def _sigma_data_model_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sigma_data_model_column.py b/pyatlan_v9/model/assets/sigma_data_model_column.py index 0fdd7a724..0917f1ff4 100644 --- a/pyatlan_v9/model/assets/sigma_data_model_column.py +++ b/pyatlan_v9/model/assets/sigma_data_model_column.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,16 +52,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .sigma_related import RelatedSigmaDataModel, RelatedSigmaDataModelColumn from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sigma_related import RelatedSigmaDataModel, RelatedSigmaDataModelColumn # ============================================================================= # FLAT ASSET CLASS @@ -709,33 +709,36 @@ def _sigma_data_model_column_from_nested( _SIGMA_DATA_MODEL_COLUMN_REL_FIELDS, SigmaDataModelColumnRelationshipAttributes, ) - return SigmaDataModelColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sigma_data_model_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sigma_data_model_column_attrs(attrs)) + kwargs.update(merged_rels) + return SigmaDataModelColumn(**kwargs) def _sigma_data_model_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sigma_dataset.py b/pyatlan_v9/model/assets/sigma_dataset.py index da2c18dfe..867902120 100644 --- a/pyatlan_v9/model/assets/sigma_dataset.py +++ b/pyatlan_v9/model/assets/sigma_dataset.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,16 +51,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .sigma_related import RelatedSigmaDataset, RelatedSigmaDatasetColumn from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sigma_related import RelatedSigmaDataset, RelatedSigmaDatasetColumn # ============================================================================= # FLAT ASSET CLASS @@ -655,33 +655,36 @@ def _sigma_dataset_from_nested(nested: SigmaDatasetNested) -> SigmaDataset: _SIGMA_DATASET_REL_FIELDS, SigmaDatasetRelationshipAttributes, ) - return SigmaDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sigma_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sigma_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return SigmaDataset(**kwargs) def _sigma_dataset_to_nested_bytes(sigma_dataset: SigmaDataset, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sigma_dataset_column.py b/pyatlan_v9/model/assets/sigma_dataset_column.py index f6406caad..bc4c10bbd 100644 --- a/pyatlan_v9/model/assets/sigma_dataset_column.py +++ b/pyatlan_v9/model/assets/sigma_dataset_column.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,16 +52,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .sigma_related import RelatedSigmaDataset, RelatedSigmaDatasetColumn from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sigma_related import RelatedSigmaDataset, RelatedSigmaDatasetColumn # ============================================================================= # FLAT ASSET CLASS @@ -685,33 +685,36 @@ def _sigma_dataset_column_from_nested( _SIGMA_DATASET_COLUMN_REL_FIELDS, SigmaDatasetColumnRelationshipAttributes, ) - return SigmaDatasetColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sigma_dataset_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sigma_dataset_column_attrs(attrs)) + kwargs.update(merged_rels) + return SigmaDatasetColumn(**kwargs) def _sigma_dataset_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sigma_page.py b/pyatlan_v9/model/assets/sigma_page.py index dcc853cf2..cb7ee07c4 100644 --- a/pyatlan_v9/model/assets/sigma_page.py +++ b/pyatlan_v9/model/assets/sigma_page.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,20 +52,13 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sigma_related import ( RelatedSigmaDataElement, RelatedSigmaPage, RelatedSigmaWorkbook, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -674,33 +674,36 @@ def _sigma_page_from_nested(nested: SigmaPageNested) -> SigmaPage: _SIGMA_PAGE_REL_FIELDS, SigmaPageRelationshipAttributes, ) - return SigmaPage( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sigma_page_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sigma_page_attrs(attrs)) + kwargs.update(merged_rels) + return SigmaPage(**kwargs) def _sigma_page_to_nested_bytes(sigma_page: SigmaPage, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sigma_workbook.py b/pyatlan_v9/model/assets/sigma_workbook.py index bf8d9a52f..a3cff7bc3 100644 --- a/pyatlan_v9/model/assets/sigma_workbook.py +++ b/pyatlan_v9/model/assets/sigma_workbook.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,16 +51,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .sigma_related import RelatedSigmaPage, RelatedSigmaWorkbook from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sigma_related import RelatedSigmaPage, RelatedSigmaWorkbook # ============================================================================= # FLAT ASSET CLASS @@ -651,33 +651,36 @@ def _sigma_workbook_from_nested(nested: SigmaWorkbookNested) -> SigmaWorkbook: _SIGMA_WORKBOOK_REL_FIELDS, SigmaWorkbookRelationshipAttributes, ) - return SigmaWorkbook( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sigma_workbook_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sigma_workbook_attrs(attrs)) + kwargs.update(merged_rels) + return SigmaWorkbook(**kwargs) def _sigma_workbook_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sisense.py b/pyatlan_v9/model/assets/sisense.py index 2ce3453bc..04620bf24 100644 --- a/pyatlan_v9/model/assets/sisense.py +++ b/pyatlan_v9/model/assets/sisense.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,16 +51,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .sisense_related import RelatedSisense from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .sisense_related import RelatedSisense # ============================================================================= # FLAT ASSET CLASS @@ -570,33 +570,36 @@ def _sisense_from_nested(nested: SisenseNested) -> Sisense: _SISENSE_REL_FIELDS, SisenseRelationshipAttributes, ) - return Sisense( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sisense_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sisense_attrs(attrs)) + kwargs.update(merged_rels) + return Sisense(**kwargs) def _sisense_to_nested_bytes(sisense: Sisense, serde: Serde) -> bytes: @@ -613,10 +616,7 @@ def _sisense_from_nested_bytes(data: bytes, serde: Serde) -> Sisense: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Sisense.CATALOG_DATASET_GUID = KeywordField("catalogDatasetGuid", "catalogDatasetGuid") Sisense.INPUT_TO_AIRFLOW_TASKS = RelationField("inputToAirflowTasks") diff --git a/pyatlan_v9/model/assets/sisense_dashboard.py b/pyatlan_v9/model/assets/sisense_dashboard.py index 184345bf9..c10cb3a44 100644 --- a/pyatlan_v9/model/assets/sisense_dashboard.py +++ b/pyatlan_v9/model/assets/sisense_dashboard.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,21 +52,14 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sisense_related import ( RelatedSisenseDashboard, RelatedSisenseDatamodel, RelatedSisenseFolder, RelatedSisenseWidget, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -648,33 +648,36 @@ def _sisense_dashboard_from_nested(nested: SisenseDashboardNested) -> SisenseDas _SISENSE_DASHBOARD_REL_FIELDS, SisenseDashboardRelationshipAttributes, ) - return SisenseDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sisense_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sisense_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return SisenseDashboard(**kwargs) def _sisense_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sisense_datamodel.py b/pyatlan_v9/model/assets/sisense_datamodel.py index d3abacdc1..5cefc0cfc 100644 --- a/pyatlan_v9/model/assets/sisense_datamodel.py +++ b/pyatlan_v9/model/assets/sisense_datamodel.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,20 +51,13 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sisense_related import ( RelatedSisenseDashboard, RelatedSisenseDatamodel, RelatedSisenseDatamodelTable, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -688,33 +688,36 @@ def _sisense_datamodel_from_nested(nested: SisenseDatamodelNested) -> SisenseDat _SISENSE_DATAMODEL_REL_FIELDS, SisenseDatamodelRelationshipAttributes, ) - return SisenseDatamodel( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sisense_datamodel_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sisense_datamodel_attrs(attrs)) + kwargs.update(merged_rels) + return SisenseDatamodel(**kwargs) def _sisense_datamodel_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sisense_datamodel_table.py b/pyatlan_v9/model/assets/sisense_datamodel_table.py index f4cb7f23a..db1231ff9 100644 --- a/pyatlan_v9/model/assets/sisense_datamodel_table.py +++ b/pyatlan_v9/model/assets/sisense_datamodel_table.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,20 +52,13 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sisense_related import ( RelatedSisenseDatamodel, RelatedSisenseDatamodelTable, RelatedSisenseWidget, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -713,33 +713,36 @@ def _sisense_datamodel_table_from_nested( _SISENSE_DATAMODEL_TABLE_REL_FIELDS, SisenseDatamodelTableRelationshipAttributes, ) - return SisenseDatamodelTable( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sisense_datamodel_table_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sisense_datamodel_table_attrs(attrs)) + kwargs.update(merged_rels) + return SisenseDatamodelTable(**kwargs) def _sisense_datamodel_table_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sisense_folder.py b/pyatlan_v9/model/assets/sisense_folder.py index b9344fa94..3f9fbe9c8 100644 --- a/pyatlan_v9/model/assets/sisense_folder.py +++ b/pyatlan_v9/model/assets/sisense_folder.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,20 +52,13 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sisense_related import ( RelatedSisenseDashboard, RelatedSisenseFolder, RelatedSisenseWidget, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -638,33 +638,36 @@ def _sisense_folder_from_nested(nested: SisenseFolderNested) -> SisenseFolder: _SISENSE_FOLDER_REL_FIELDS, SisenseFolderRelationshipAttributes, ) - return SisenseFolder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sisense_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sisense_folder_attrs(attrs)) + kwargs.update(merged_rels) + return SisenseFolder(**kwargs) def _sisense_folder_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sisense_widget.py b/pyatlan_v9/model/assets/sisense_widget.py index 9b7aef913..6d099e129 100644 --- a/pyatlan_v9/model/assets/sisense_widget.py +++ b/pyatlan_v9/model/assets/sisense_widget.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,21 +52,14 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sisense_related import ( RelatedSisenseDashboard, RelatedSisenseDatamodelTable, RelatedSisenseFolder, RelatedSisenseWidget, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -679,33 +679,36 @@ def _sisense_widget_from_nested(nested: SisenseWidgetNested) -> SisenseWidget: _SISENSE_WIDGET_REL_FIELDS, SisenseWidgetRelationshipAttributes, ) - return SisenseWidget( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sisense_widget_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sisense_widget_attrs(attrs)) + kwargs.update(merged_rels) + return SisenseWidget(**kwargs) def _sisense_widget_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/skill.py b/pyatlan_v9/model/assets/skill.py index 0ee881eff..26265b0f1 100644 --- a/pyatlan_v9/model/assets/skill.py +++ b/pyatlan_v9/model/assets/skill.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .agent_related import RelatedAgent from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -46,16 +53,9 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .skill_artifact_related import RelatedSkillArtifact +from .skill_related import RelatedSkill from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .skill_related import RelatedSkill # ============================================================================= # FLAT ASSET CLASS @@ -706,33 +706,36 @@ def _skill_from_nested(nested: SkillNested) -> Skill: _SKILL_REL_FIELDS, SkillRelationshipAttributes, ) - return Skill( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_skill_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_skill_attrs(attrs)) + kwargs.update(merged_rels) + return Skill(**kwargs) def _skill_to_nested_bytes(skill: Skill, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/skill_artifact.py b/pyatlan_v9/model/assets/skill_artifact.py index 1ddc05574..70d2751b2 100644 --- a/pyatlan_v9/model/assets/skill_artifact.py +++ b/pyatlan_v9/model/assets/skill_artifact.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,17 +51,10 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .skill_artifact_related import RelatedSkillArtifact from .skill_related import RelatedSkill from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .skill_artifact_related import RelatedSkillArtifact # ============================================================================= # FLAT ASSET CLASS @@ -689,33 +689,36 @@ def _skill_artifact_from_nested(nested: SkillArtifactNested) -> SkillArtifact: _SKILL_ARTIFACT_REL_FIELDS, SkillArtifactRelationshipAttributes, ) - return SkillArtifact( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_skill_artifact_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_skill_artifact_attrs(attrs)) + kwargs.update(merged_rels) + return SkillArtifact(**kwargs) def _skill_artifact_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/snowflake.py b/pyatlan_v9/model/assets/snowflake.py index 8dfafee49..b23bcd39f 100644 --- a/pyatlan_v9/model/assets/snowflake.py +++ b/pyatlan_v9/model/assets/snowflake.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -51,20 +58,13 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .snowflake_related import RelatedSnowflake, RelatedSnowflakeSemanticLogicalTable from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_insight_related import ( RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .snowflake_related import RelatedSnowflake, RelatedSnowflakeSemanticLogicalTable # ============================================================================= # FLAT ASSET CLASS @@ -998,33 +998,36 @@ def _snowflake_from_nested(nested: SnowflakeNested) -> Snowflake: _SNOWFLAKE_REL_FIELDS, SnowflakeRelationshipAttributes, ) - return Snowflake( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_snowflake_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_snowflake_attrs(attrs)) + kwargs.update(merged_rels) + return Snowflake(**kwargs) def _snowflake_to_nested_bytes(snowflake: Snowflake, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/snowflake_ai_model_context.py b/pyatlan_v9/model/assets/snowflake_ai_model_context.py index 5fcfc60f9..7a1f1c67b 100644 --- a/pyatlan_v9/model/assets/snowflake_ai_model_context.py +++ b/pyatlan_v9/model/assets/snowflake_ai_model_context.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .ai_related import RelatedAIApplication, RelatedAIModelVersion from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -53,6 +60,11 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .snowflake_related import ( + RelatedSnowflakeAIModelContext, + RelatedSnowflakeAIModelVersion, + RelatedSnowflakeSemanticLogicalTable, +) from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_insight_related import ( @@ -60,18 +72,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .snowflake_related import ( - RelatedSnowflakeAIModelContext, - RelatedSnowflakeAIModelVersion, - RelatedSnowflakeSemanticLogicalTable, -) # ============================================================================= # FLAT ASSET CLASS @@ -1215,33 +1215,36 @@ def _snowflake_ai_model_context_from_nested( _SNOWFLAKE_AI_MODEL_CONTEXT_REL_FIELDS, SnowflakeAIModelContextRelationshipAttributes, ) - return SnowflakeAIModelContext( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_snowflake_ai_model_context_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_snowflake_ai_model_context_attrs(attrs)) + kwargs.update(merged_rels) + return SnowflakeAIModelContext(**kwargs) def _snowflake_ai_model_context_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/snowflake_ai_model_version.py b/pyatlan_v9/model/assets/snowflake_ai_model_version.py index 173c0c021..99eab5712 100644 --- a/pyatlan_v9/model/assets/snowflake_ai_model_version.py +++ b/pyatlan_v9/model/assets/snowflake_ai_model_version.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .ai_related import RelatedAIModel from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck @@ -53,24 +60,17 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .snowflake_related import ( + RelatedSnowflakeAIModelContext, + RelatedSnowflakeAIModelVersion, + RelatedSnowflakeSemanticLogicalTable, +) from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_insight_related import ( RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .snowflake_related import ( - RelatedSnowflakeAIModelContext, - RelatedSnowflakeAIModelVersion, - RelatedSnowflakeSemanticLogicalTable, -) # ============================================================================= # FLAT ASSET CLASS @@ -1265,33 +1265,36 @@ def _snowflake_ai_model_version_from_nested( _SNOWFLAKE_AI_MODEL_VERSION_REL_FIELDS, SnowflakeAIModelVersionRelationshipAttributes, ) - return SnowflakeAIModelVersion( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_snowflake_ai_model_version_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_snowflake_ai_model_version_attrs(attrs)) + kwargs.update(merged_rels) + return SnowflakeAIModelVersion(**kwargs) def _snowflake_ai_model_version_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/snowflake_listing.py b/pyatlan_v9/model/assets/snowflake_listing.py index e564bf27a..43b40d9d0 100644 --- a/pyatlan_v9/model/assets/snowflake_listing.py +++ b/pyatlan_v9/model/assets/snowflake_listing.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -52,24 +59,17 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .snowflake_related import ( + RelatedSnowflakeListing, + RelatedSnowflakeSemanticLogicalTable, + RelatedSnowflakeShare, +) from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_insight_related import ( RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .snowflake_related import ( - RelatedSnowflakeListing, - RelatedSnowflakeSemanticLogicalTable, - RelatedSnowflakeShare, -) # ============================================================================= # FLAT ASSET CLASS @@ -1188,33 +1188,36 @@ def _snowflake_listing_from_nested(nested: SnowflakeListingNested) -> SnowflakeL _SNOWFLAKE_LISTING_REL_FIELDS, SnowflakeListingRelationshipAttributes, ) - return SnowflakeListing( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_snowflake_listing_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_snowflake_listing_attrs(attrs)) + kwargs.update(merged_rels) + return SnowflakeListing(**kwargs) def _snowflake_listing_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/snowflake_semantic_dimension.py b/pyatlan_v9/model/assets/snowflake_semantic_dimension.py index f93c4cdd1..dcaa786cb 100644 --- a/pyatlan_v9/model/assets/snowflake_semantic_dimension.py +++ b/pyatlan_v9/model/assets/snowflake_semantic_dimension.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -53,23 +60,16 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .semantic_related import RelatedSemanticModel +from .snowflake_related import ( + RelatedSnowflakeSemanticDimension, + RelatedSnowflakeSemanticLogicalTable, +) from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_insight_related import ( RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .snowflake_related import ( - RelatedSnowflakeSemanticDimension, - RelatedSnowflakeSemanticLogicalTable, -) # ============================================================================= # FLAT ASSET CLASS @@ -1178,33 +1178,36 @@ def _snowflake_semantic_dimension_from_nested( _SNOWFLAKE_SEMANTIC_DIMENSION_REL_FIELDS, SnowflakeSemanticDimensionRelationshipAttributes, ) - return SnowflakeSemanticDimension( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_snowflake_semantic_dimension_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_snowflake_semantic_dimension_attrs(attrs)) + kwargs.update(merged_rels) + return SnowflakeSemanticDimension(**kwargs) def _snowflake_semantic_dimension_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/snowflake_semantic_fact.py b/pyatlan_v9/model/assets/snowflake_semantic_fact.py index b383b04cf..cf470af32 100644 --- a/pyatlan_v9/model/assets/snowflake_semantic_fact.py +++ b/pyatlan_v9/model/assets/snowflake_semantic_fact.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -53,23 +60,16 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .semantic_related import RelatedSemanticModel +from .snowflake_related import ( + RelatedSnowflakeSemanticFact, + RelatedSnowflakeSemanticLogicalTable, +) from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_insight_related import ( RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .snowflake_related import ( - RelatedSnowflakeSemanticFact, - RelatedSnowflakeSemanticLogicalTable, -) # ============================================================================= # FLAT ASSET CLASS @@ -1176,33 +1176,36 @@ def _snowflake_semantic_fact_from_nested( _SNOWFLAKE_SEMANTIC_FACT_REL_FIELDS, SnowflakeSemanticFactRelationshipAttributes, ) - return SnowflakeSemanticFact( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_snowflake_semantic_fact_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_snowflake_semantic_fact_attrs(attrs)) + kwargs.update(merged_rels) + return SnowflakeSemanticFact(**kwargs) def _snowflake_semantic_fact_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/snowflake_semantic_logical_table.py b/pyatlan_v9/model/assets/snowflake_semantic_logical_table.py index 17bfa3396..afda059d8 100644 --- a/pyatlan_v9/model/assets/snowflake_semantic_logical_table.py +++ b/pyatlan_v9/model/assets/snowflake_semantic_logical_table.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -53,20 +60,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .semantic_related import RelatedSemanticModel -from .soda_related import RelatedSodaCheck -from .spark_related import RelatedSparkJob -from .sql_insight_related import ( - RelatedSqlInsightBusinessQuestion, - RelatedSqlInsightJoin, -) -from .sql_related import RelatedSQL -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .snowflake_related import ( RelatedSnowflakeSemanticDimension, RelatedSnowflakeSemanticFact, @@ -74,6 +67,13 @@ RelatedSnowflakeSemanticMetric, RelatedSnowflakeSemanticView, ) +from .soda_related import RelatedSodaCheck +from .spark_related import RelatedSparkJob +from .sql_insight_related import ( + RelatedSqlInsightBusinessQuestion, + RelatedSqlInsightJoin, +) +from .sql_related import RelatedSQL # ============================================================================= # FLAT ASSET CLASS @@ -1245,33 +1245,36 @@ def _snowflake_semantic_logical_table_from_nested( _SNOWFLAKE_SEMANTIC_LOGICAL_TABLE_REL_FIELDS, SnowflakeSemanticLogicalTableRelationshipAttributes, ) - return SnowflakeSemanticLogicalTable( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_snowflake_semantic_logical_table_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_snowflake_semantic_logical_table_attrs(attrs)) + kwargs.update(merged_rels) + return SnowflakeSemanticLogicalTable(**kwargs) def _snowflake_semantic_logical_table_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/snowflake_semantic_metric.py b/pyatlan_v9/model/assets/snowflake_semantic_metric.py index bd0dccef8..958668a4c 100644 --- a/pyatlan_v9/model/assets/snowflake_semantic_metric.py +++ b/pyatlan_v9/model/assets/snowflake_semantic_metric.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -53,6 +60,10 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .snowflake_related import ( + RelatedSnowflakeSemanticLogicalTable, + RelatedSnowflakeSemanticMetric, +) from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_insight_related import ( @@ -60,17 +71,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedColumn -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .snowflake_related import ( - RelatedSnowflakeSemanticLogicalTable, - RelatedSnowflakeSemanticMetric, -) # ============================================================================= # FLAT ASSET CLASS @@ -1220,33 +1220,36 @@ def _snowflake_semantic_metric_from_nested( _SNOWFLAKE_SEMANTIC_METRIC_REL_FIELDS, SnowflakeSemanticMetricRelationshipAttributes, ) - return SnowflakeSemanticMetric( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_snowflake_semantic_metric_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_snowflake_semantic_metric_attrs(attrs)) + kwargs.update(merged_rels) + return SnowflakeSemanticMetric(**kwargs) def _snowflake_semantic_metric_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/snowflake_semantic_view.py b/pyatlan_v9/model/assets/snowflake_semantic_view.py index 1e1f94d14..b62aaae5d 100644 --- a/pyatlan_v9/model/assets/snowflake_semantic_view.py +++ b/pyatlan_v9/model/assets/snowflake_semantic_view.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -57,6 +64,10 @@ RelatedSemanticEntity, RelatedSemanticMeasure, ) +from .snowflake_related import ( + RelatedSnowflakeSemanticLogicalTable, + RelatedSnowflakeSemanticView, +) from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_insight_related import ( @@ -64,17 +75,6 @@ RelatedSqlInsightJoin, ) from .sql_related import RelatedSchema -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .snowflake_related import ( - RelatedSnowflakeSemanticLogicalTable, - RelatedSnowflakeSemanticView, -) # ============================================================================= # FLAT ASSET CLASS @@ -1085,33 +1085,36 @@ def _snowflake_semantic_view_from_nested( _SNOWFLAKE_SEMANTIC_VIEW_REL_FIELDS, SnowflakeSemanticViewRelationshipAttributes, ) - return SnowflakeSemanticView( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_snowflake_semantic_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_snowflake_semantic_view_attrs(attrs)) + kwargs.update(merged_rels) + return SnowflakeSemanticView(**kwargs) def _snowflake_semantic_view_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/snowflake_share.py b/pyatlan_v9/model/assets/snowflake_share.py index 6d16edcb7..f74b3f95d 100644 --- a/pyatlan_v9/model/assets/snowflake_share.py +++ b/pyatlan_v9/model/assets/snowflake_share.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -52,24 +59,17 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .snowflake_related import ( + RelatedSnowflakeListing, + RelatedSnowflakeSemanticLogicalTable, + RelatedSnowflakeShare, +) from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_insight_related import ( RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .snowflake_related import ( - RelatedSnowflakeListing, - RelatedSnowflakeSemanticLogicalTable, - RelatedSnowflakeShare, -) # ============================================================================= # FLAT ASSET CLASS @@ -1080,33 +1080,36 @@ def _snowflake_share_from_nested(nested: SnowflakeShareNested) -> SnowflakeShare _SNOWFLAKE_SHARE_REL_FIELDS, SnowflakeShareRelationshipAttributes, ) - return SnowflakeShare( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_snowflake_share_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_snowflake_share_attrs(attrs)) + kwargs.update(merged_rels) + return SnowflakeShare(**kwargs) def _snowflake_share_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/soda.py b/pyatlan_v9/model/assets/soda.py index fd7c225d7..cf379d97e 100644 --- a/pyatlan_v9/model/assets/soda.py +++ b/pyatlan_v9/model/assets/soda.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -44,15 +51,8 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject -from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .soda_related import RelatedSoda, RelatedSodaCheck +from .spark_related import RelatedSparkJob # ============================================================================= # FLAT ASSET CLASS @@ -574,33 +574,36 @@ def _soda_from_nested(nested: SodaNested) -> Soda: _SODA_REL_FIELDS, SodaRelationshipAttributes, ) - return Soda( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_soda_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_soda_attrs(attrs)) + kwargs.update(merged_rels) + return Soda(**kwargs) def _soda_to_nested_bytes(soda: Soda, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/soda_check.py b/pyatlan_v9/model/assets/soda_check.py index e896fb9c7..6d0107d38 100644 --- a/pyatlan_v9/model/assets/soda_check.py +++ b/pyatlan_v9/model/assets/soda_check.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,16 +52,9 @@ from .referenceable_related import RelatedReferenceable from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject +from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob from .sql_related import RelatedColumn -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - -from .soda_related import RelatedSodaCheck # ============================================================================= # FLAT ASSET CLASS @@ -656,33 +656,36 @@ def _soda_check_from_nested(nested: SodaCheckNested) -> SodaCheck: _SODA_CHECK_REL_FIELDS, SodaCheckRelationshipAttributes, ) - return SodaCheck( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_soda_check_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_soda_check_attrs(attrs)) + kwargs.update(merged_rels) + return SodaCheck(**kwargs) def _soda_check_to_nested_bytes(soda_check: SodaCheck, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/source_tag.py b/pyatlan_v9/model/assets/source_tag.py index c3212f580..11c12ced2 100644 --- a/pyatlan_v9/model/assets/source_tag.py +++ b/pyatlan_v9/model/assets/source_tag.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tag_related import RelatedSourceTag # ============================================================================= @@ -624,33 +624,36 @@ def _source_tag_from_nested(nested: SourceTagNested) -> SourceTag: _SOURCE_TAG_REL_FIELDS, SourceTagRelationshipAttributes, ) - return SourceTag( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_source_tag_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_source_tag_attrs(attrs)) + kwargs.update(merged_rels) + return SourceTag(**kwargs) def _source_tag_to_nested_bytes(source_tag: SourceTag, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/spark.py b/pyatlan_v9/model/assets/spark.py index b01a078e2..b7a5013c3 100644 --- a/pyatlan_v9/model/assets/spark.py +++ b/pyatlan_v9/model/assets/spark.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflow, RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -45,13 +52,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .spark_related import RelatedSpark, RelatedSparkJob # ============================================================================= @@ -626,33 +626,36 @@ def _spark_from_nested(nested: SparkNested) -> Spark: _SPARK_REL_FIELDS, SparkRelationshipAttributes, ) - return Spark( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_spark_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_spark_attrs(attrs)) + kwargs.update(merged_rels) + return Spark(**kwargs) def _spark_to_nested_bytes(spark: Spark, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/spark_job.py b/pyatlan_v9/model/assets/spark_job.py index 27862e6d7..712649255 100644 --- a/pyatlan_v9/model/assets/spark_job.py +++ b/pyatlan_v9/model/assets/spark_job.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflow, RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .spark_related import RelatedSparkJob # ============================================================================= @@ -684,33 +684,36 @@ def _spark_job_from_nested(nested: SparkJobNested) -> SparkJob: _SPARK_JOB_REL_FIELDS, SparkJobRelationshipAttributes, ) - return SparkJob( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_spark_job_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_spark_job_attrs(attrs)) + kwargs.update(merged_rels) + return SparkJob(**kwargs) def _spark_job_to_nested_bytes(spark_job: SparkJob, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sql.py b/pyatlan_v9/model/assets/sql.py index 9ac1d65f2..f6a4e5630 100644 --- a/pyatlan_v9/model/assets/sql.py +++ b/pyatlan_v9/model/assets/sql.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -58,13 +65,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sql_related import RelatedSQL # ============================================================================= @@ -993,33 +993,36 @@ def _sql_from_nested(nested: SQLNested) -> SQL: _SQL_REL_FIELDS, SQLRelationshipAttributes, ) - return SQL( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sql_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sql_attrs(attrs)) + kwargs.update(merged_rels) + return SQL(**kwargs) def _sql_to_nested_bytes(sql: SQL, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/sql_insight.py b/pyatlan_v9/model/assets/sql_insight.py index 78d053b5c..1d44ce37b 100644 --- a/pyatlan_v9/model/assets/sql_insight.py +++ b/pyatlan_v9/model/assets/sql_insight.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sql_insight_related import RelatedSqlInsight # ============================================================================= @@ -572,33 +572,36 @@ def _sql_insight_from_nested(nested: SqlInsightNested) -> SqlInsight: _SQL_INSIGHT_REL_FIELDS, SqlInsightRelationshipAttributes, ) - return SqlInsight( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sql_insight_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sql_insight_attrs(attrs)) + kwargs.update(merged_rels) + return SqlInsight(**kwargs) def _sql_insight_to_nested_bytes(sql_insight: SqlInsight, serde: Serde) -> bytes: @@ -615,10 +618,7 @@ def _sql_insight_from_nested_bytes(data: bytes, serde: Serde) -> SqlInsight: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 SqlInsight.CATALOG_DATASET_GUID = KeywordField( "catalogDatasetGuid", "catalogDatasetGuid" diff --git a/pyatlan_v9/model/assets/sql_insight_business_question.py b/pyatlan_v9/model/assets/sql_insight_business_question.py index ffefe31f7..1971b0cd1 100644 --- a/pyatlan_v9/model/assets/sql_insight_business_question.py +++ b/pyatlan_v9/model/assets/sql_insight_business_question.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -48,15 +55,8 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from .sql_related import RelatedSQL -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sql_insight_related import RelatedSqlInsightBusinessQuestion +from .sql_related import RelatedSQL # ============================================================================= # FLAT ASSET CLASS @@ -712,33 +712,36 @@ def _sql_insight_business_question_from_nested( _SQL_INSIGHT_BUSINESS_QUESTION_REL_FIELDS, SqlInsightBusinessQuestionRelationshipAttributes, ) - return SqlInsightBusinessQuestion( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sql_insight_business_question_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sql_insight_business_question_attrs(attrs)) + kwargs.update(merged_rels) + return SqlInsightBusinessQuestion(**kwargs) def _sql_insight_business_question_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sql_insight_filter.py b/pyatlan_v9/model/assets/sql_insight_filter.py index 1baf28a89..182965b59 100644 --- a/pyatlan_v9/model/assets/sql_insight_filter.py +++ b/pyatlan_v9/model/assets/sql_insight_filter.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -48,15 +55,8 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from .sql_related import RelatedColumn -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sql_insight_related import RelatedSqlInsightFilter +from .sql_related import RelatedColumn # ============================================================================= # FLAT ASSET CLASS @@ -713,33 +713,36 @@ def _sql_insight_filter_from_nested(nested: SqlInsightFilterNested) -> SqlInsigh _SQL_INSIGHT_FILTER_REL_FIELDS, SqlInsightFilterRelationshipAttributes, ) - return SqlInsightFilter( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sql_insight_filter_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sql_insight_filter_attrs(attrs)) + kwargs.update(merged_rels) + return SqlInsightFilter(**kwargs) def _sql_insight_filter_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/sql_insight_join.py b/pyatlan_v9/model/assets/sql_insight_join.py index 4e01814d2..4f19c2b0f 100644 --- a/pyatlan_v9/model/assets/sql_insight_join.py +++ b/pyatlan_v9/model/assets/sql_insight_join.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,15 +54,8 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from .sql_related import RelatedSQL -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .sql_insight_related import RelatedSqlInsightJoin +from .sql_related import RelatedSQL # ============================================================================= # FLAT ASSET CLASS @@ -712,33 +712,36 @@ def _sql_insight_join_from_nested(nested: SqlInsightJoinNested) -> SqlInsightJoi _SQL_INSIGHT_JOIN_REL_FIELDS, SqlInsightJoinRelationshipAttributes, ) - return SqlInsightJoin( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_sql_insight_join_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_sql_insight_join_attrs(attrs)) + kwargs.update(merged_rels) + return SqlInsightJoin(**kwargs) def _sql_insight_join_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/ssrs.py b/pyatlan_v9/model/assets/ssrs.py index d2db7599b..07b73afa3 100644 --- a/pyatlan_v9/model/assets/ssrs.py +++ b/pyatlan_v9/model/assets/ssrs.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .ssrs_related import RelatedSSRS # ============================================================================= @@ -685,33 +685,36 @@ def _ssrs_from_nested(nested: SSRSNested) -> SSRS: _SSRS_REL_FIELDS, SSRSRelationshipAttributes, ) - return SSRS( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_ssrs_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_ssrs_attrs(attrs)) + kwargs.update(merged_rels) + return SSRS(**kwargs) def _ssrs_to_nested_bytes(ssrs: SSRS, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/ssrs_data_set.py b/pyatlan_v9/model/assets/ssrs_data_set.py index 63fa6c7c1..2e6c41d77 100644 --- a/pyatlan_v9/model/assets/ssrs_data_set.py +++ b/pyatlan_v9/model/assets/ssrs_data_set.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .ssrs_related import RelatedSSRSDataSet, RelatedSSRSField, RelatedSSRSReport # ============================================================================= @@ -864,33 +864,36 @@ def _ssrs_data_set_from_nested(nested: SSRSDataSetNested) -> SSRSDataSet: _SSRS_DATA_SET_REL_FIELDS, SSRSDataSetRelationshipAttributes, ) - return SSRSDataSet( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_ssrs_data_set_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_ssrs_data_set_attrs(attrs)) + kwargs.update(merged_rels) + return SSRSDataSet(**kwargs) def _ssrs_data_set_to_nested_bytes(ssrs_data_set: SSRSDataSet, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/ssrs_field.py b/pyatlan_v9/model/assets/ssrs_field.py index 98c78ecbb..795a4bf03 100644 --- a/pyatlan_v9/model/assets/ssrs_field.py +++ b/pyatlan_v9/model/assets/ssrs_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .ssrs_related import RelatedSSRSDataSet, RelatedSSRSField # ============================================================================= @@ -834,33 +834,36 @@ def _ssrs_field_from_nested(nested: SSRSFieldNested) -> SSRSField: _SSRS_FIELD_REL_FIELDS, SSRSFieldRelationshipAttributes, ) - return SSRSField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_ssrs_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_ssrs_field_attrs(attrs)) + kwargs.update(merged_rels) + return SSRSField(**kwargs) def _ssrs_field_to_nested_bytes(ssrs_field: SSRSField, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/ssrs_folder.py b/pyatlan_v9/model/assets/ssrs_folder.py index 24b955671..b5d2e8c59 100644 --- a/pyatlan_v9/model/assets/ssrs_folder.py +++ b/pyatlan_v9/model/assets/ssrs_folder.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .ssrs_related import RelatedSSRSFolder, RelatedSSRSReport # ============================================================================= @@ -726,33 +726,36 @@ def _ssrs_folder_from_nested(nested: SSRSFolderNested) -> SSRSFolder: _SSRS_FOLDER_REL_FIELDS, SSRSFolderRelationshipAttributes, ) - return SSRSFolder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_ssrs_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_ssrs_folder_attrs(attrs)) + kwargs.update(merged_rels) + return SSRSFolder(**kwargs) def _ssrs_folder_to_nested_bytes(ssrs_folder: SSRSFolder, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/ssrs_report.py b/pyatlan_v9/model/assets/ssrs_report.py index df8769cc4..81c7988b4 100644 --- a/pyatlan_v9/model/assets/ssrs_report.py +++ b/pyatlan_v9/model/assets/ssrs_report.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .ssrs_related import RelatedSSRSDataSet, RelatedSSRSFolder, RelatedSSRSReport # ============================================================================= @@ -774,33 +774,36 @@ def _ssrs_report_from_nested(nested: SSRSReportNested) -> SSRSReport: _SSRS_REPORT_REL_FIELDS, SSRSReportRelationshipAttributes, ) - return SSRSReport( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_ssrs_report_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_ssrs_report_attrs(attrs)) + kwargs.update(merged_rels) + return SSRSReport(**kwargs) def _ssrs_report_to_nested_bytes(ssrs_report: SSRSReport, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/starburst.py b/pyatlan_v9/model/assets/starburst.py index 6ab40069d..2c2172a9d 100644 --- a/pyatlan_v9/model/assets/starburst.py +++ b/pyatlan_v9/model/assets/starburst.py @@ -19,6 +19,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -58,13 +65,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .starburst_related import RelatedStarburst # ============================================================================= @@ -1026,33 +1026,36 @@ def _starburst_from_nested(nested: StarburstNested) -> Starburst: _STARBURST_REL_FIELDS, StarburstRelationshipAttributes, ) - return Starburst( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_starburst_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_starburst_attrs(attrs)) + kwargs.update(merged_rels) + return Starburst(**kwargs) def _starburst_to_nested_bytes(starburst: Starburst, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/starburst_dataset.py b/pyatlan_v9/model/assets/starburst_dataset.py index 8aafed59b..e619c2fe7 100644 --- a/pyatlan_v9/model/assets/starburst_dataset.py +++ b/pyatlan_v9/model/assets/starburst_dataset.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -66,13 +73,6 @@ RelatedTable, RelatedTablePartition, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .starburst_related import RelatedStarburstDataset, RelatedStarburstDatasetColumn # ============================================================================= @@ -1394,33 +1394,36 @@ def _starburst_dataset_from_nested(nested: StarburstDatasetNested) -> StarburstD _STARBURST_DATASET_REL_FIELDS, StarburstDatasetRelationshipAttributes, ) - return StarburstDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_starburst_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_starburst_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return StarburstDataset(**kwargs) def _starburst_dataset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/starburst_dataset_column.py b/pyatlan_v9/model/assets/starburst_dataset_column.py index 0e677bdaf..c32aae5c6 100644 --- a/pyatlan_v9/model/assets/starburst_dataset_column.py +++ b/pyatlan_v9/model/assets/starburst_dataset_column.py @@ -20,6 +20,13 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -76,13 +83,6 @@ RelatedTablePartition, RelatedView, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .starburst_related import RelatedStarburstDataset, RelatedStarburstDatasetColumn # ============================================================================= @@ -1973,33 +1973,36 @@ def _starburst_dataset_column_from_nested( _STARBURST_DATASET_COLUMN_REL_FIELDS, StarburstDatasetColumnRelationshipAttributes, ) - return StarburstDatasetColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_starburst_dataset_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_starburst_dataset_column_attrs(attrs)) + kwargs.update(merged_rels) + return StarburstDatasetColumn(**kwargs) def _starburst_dataset_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/superset.py b/pyatlan_v9/model/assets/superset.py index c999af8c5..6b419227e 100644 --- a/pyatlan_v9/model/assets/superset.py +++ b/pyatlan_v9/model/assets/superset.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .superset_related import RelatedSuperset # ============================================================================= @@ -592,33 +592,36 @@ def _superset_from_nested(nested: SupersetNested) -> Superset: _SUPERSET_REL_FIELDS, SupersetRelationshipAttributes, ) - return Superset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_superset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_superset_attrs(attrs)) + kwargs.update(merged_rels) + return Superset(**kwargs) def _superset_to_nested_bytes(superset: Superset, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/superset_chart.py b/pyatlan_v9/model/assets/superset_chart.py index 69b4a74ec..01643fce4 100644 --- a/pyatlan_v9/model/assets/superset_chart.py +++ b/pyatlan_v9/model/assets/superset_chart.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .superset_related import RelatedSupersetChart, RelatedSupersetDashboard # ============================================================================= @@ -690,33 +690,36 @@ def _superset_chart_from_nested(nested: SupersetChartNested) -> SupersetChart: _SUPERSET_CHART_REL_FIELDS, SupersetChartRelationshipAttributes, ) - return SupersetChart( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_superset_chart_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_superset_chart_attrs(attrs)) + kwargs.update(merged_rels) + return SupersetChart(**kwargs) def _superset_chart_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/superset_dashboard.py b/pyatlan_v9/model/assets/superset_dashboard.py index 330022f41..1d2ca8724 100644 --- a/pyatlan_v9/model/assets/superset_dashboard.py +++ b/pyatlan_v9/model/assets/superset_dashboard.py @@ -19,6 +19,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .superset_related import ( RelatedSupersetChart, RelatedSupersetDashboard, @@ -728,33 +728,36 @@ def _superset_dashboard_from_nested( _SUPERSET_DASHBOARD_REL_FIELDS, SupersetDashboardRelationshipAttributes, ) - return SupersetDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_superset_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_superset_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return SupersetDashboard(**kwargs) def _superset_dashboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/superset_dataset.py b/pyatlan_v9/model/assets/superset_dataset.py index 3454fc583..6cee1f3cd 100644 --- a/pyatlan_v9/model/assets/superset_dataset.py +++ b/pyatlan_v9/model/assets/superset_dataset.py @@ -19,6 +19,14 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,14 +55,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .superset_related import RelatedSupersetDashboard, RelatedSupersetDataset # ============================================================================= @@ -705,33 +705,36 @@ def _superset_dataset_from_nested(nested: SupersetDatasetNested) -> SupersetData _SUPERSET_DATASET_REL_FIELDS, SupersetDatasetRelationshipAttributes, ) - return SupersetDataset( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_superset_dataset_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_superset_dataset_attrs(attrs)) + kwargs.update(merged_rels) + return SupersetDataset(**kwargs) def _superset_dataset_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/table.py b/pyatlan_v9/model/assets/table.py index ceea6ca63..54d81113b 100644 --- a/pyatlan_v9/model/assets/table.py +++ b/pyatlan_v9/model/assets/table.py @@ -20,6 +20,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -59,14 +67,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .sql_related import ( RelatedColumn, RelatedQuery, @@ -1393,33 +1393,36 @@ def _table_from_nested(nested: TableNested) -> Table: _TABLE_REL_FIELDS, TableRelationshipAttributes, ) - return Table( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_table_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_table_attrs(attrs)) + kwargs.update(merged_rels) + return Table(**kwargs) def _table_to_nested_bytes(table: Table, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/table_partition.py b/pyatlan_v9/model/assets/table_partition.py index f66200582..2ec4987ca 100644 --- a/pyatlan_v9/model/assets/table_partition.py +++ b/pyatlan_v9/model/assets/table_partition.py @@ -20,6 +20,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -59,14 +67,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .sql_related import RelatedColumn, RelatedTable, RelatedTablePartition # ============================================================================= @@ -1308,33 +1308,36 @@ def _table_partition_from_nested(nested: TablePartitionNested) -> TablePartition _TABLE_PARTITION_REL_FIELDS, TablePartitionRelationshipAttributes, ) - return TablePartition( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_table_partition_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_table_partition_attrs(attrs)) + kwargs.update(merged_rels) + return TablePartition(**kwargs) def _table_partition_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/tableau.py b/pyatlan_v9/model/assets/tableau.py index fcc5044f9..882a9e8a1 100644 --- a/pyatlan_v9/model/assets/tableau.py +++ b/pyatlan_v9/model/assets/tableau.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import RelatedTableau # ============================================================================= @@ -592,33 +592,36 @@ def _tableau_from_nested(nested: TableauNested) -> Tableau: _TABLEAU_REL_FIELDS, TableauRelationshipAttributes, ) - return Tableau( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_attrs(attrs)) + kwargs.update(merged_rels) + return Tableau(**kwargs) def _tableau_to_nested_bytes(tableau: Tableau, serde: Serde) -> bytes: @@ -635,10 +638,7 @@ def _tableau_from_nested_bytes(data: bytes, serde: Serde) -> Tableau: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Tableau.TABLEAU_PROJECT_HIERARCHY_QUALIFIED_NAMES = KeywordField( "tableauProjectHierarchyQualifiedNames", "tableauProjectHierarchyQualifiedNames" diff --git a/pyatlan_v9/model/assets/tableau_calculated_field.py b/pyatlan_v9/model/assets/tableau_calculated_field.py index bfc0ddba6..10a4d8d9e 100644 --- a/pyatlan_v9/model/assets/tableau_calculated_field.py +++ b/pyatlan_v9/model/assets/tableau_calculated_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import ( RelatedTableauCalculatedField, RelatedTableauDatasource, @@ -765,33 +765,36 @@ def _tableau_calculated_field_from_nested( _TABLEAU_CALCULATED_FIELD_REL_FIELDS, TableauCalculatedFieldRelationshipAttributes, ) - return TableauCalculatedField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_calculated_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_calculated_field_attrs(attrs)) + kwargs.update(merged_rels) + return TableauCalculatedField(**kwargs) def _tableau_calculated_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/tableau_dashboard.py b/pyatlan_v9/model/assets/tableau_dashboard.py index 8b6724a16..df33c4d03 100644 --- a/pyatlan_v9/model/assets/tableau_dashboard.py +++ b/pyatlan_v9/model/assets/tableau_dashboard.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import ( RelatedTableauDashboard, RelatedTableauDashboardField, @@ -729,33 +729,36 @@ def _tableau_dashboard_from_nested(nested: TableauDashboardNested) -> TableauDas _TABLEAU_DASHBOARD_REL_FIELDS, TableauDashboardRelationshipAttributes, ) - return TableauDashboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_dashboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_dashboard_attrs(attrs)) + kwargs.update(merged_rels) + return TableauDashboard(**kwargs) def _tableau_dashboard_to_nested_bytes( @@ -774,10 +777,7 @@ def _tableau_dashboard_from_nested_bytes(data: bytes, serde: Serde) -> TableauDa # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 TableauDashboard.SITE_QUALIFIED_NAME = KeywordField( "siteQualifiedName", "siteQualifiedName" diff --git a/pyatlan_v9/model/assets/tableau_dashboard_field.py b/pyatlan_v9/model/assets/tableau_dashboard_field.py index 8adbaa552..475031169 100644 --- a/pyatlan_v9/model/assets/tableau_dashboard_field.py +++ b/pyatlan_v9/model/assets/tableau_dashboard_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import ( RelatedTableauDashboard, RelatedTableauDashboardField, @@ -818,33 +818,36 @@ def _tableau_dashboard_field_from_nested( _TABLEAU_DASHBOARD_FIELD_REL_FIELDS, TableauDashboardFieldRelationshipAttributes, ) - return TableauDashboardField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_dashboard_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_dashboard_field_attrs(attrs)) + kwargs.update(merged_rels) + return TableauDashboardField(**kwargs) def _tableau_dashboard_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/tableau_datasource.py b/pyatlan_v9/model/assets/tableau_datasource.py index 47c5812c3..05c141004 100644 --- a/pyatlan_v9/model/assets/tableau_datasource.py +++ b/pyatlan_v9/model/assets/tableau_datasource.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import ( RelatedTableauDatasource, RelatedTableauDatasourceField, @@ -773,33 +773,36 @@ def _tableau_datasource_from_nested( _TABLEAU_DATASOURCE_REL_FIELDS, TableauDatasourceRelationshipAttributes, ) - return TableauDatasource( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_datasource_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_datasource_attrs(attrs)) + kwargs.update(merged_rels) + return TableauDatasource(**kwargs) def _tableau_datasource_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/tableau_datasource_field.py b/pyatlan_v9/model/assets/tableau_datasource_field.py index 7dbd2a09d..382494170 100644 --- a/pyatlan_v9/model/assets/tableau_datasource_field.py +++ b/pyatlan_v9/model/assets/tableau_datasource_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import ( RelatedTableauDatasource, RelatedTableauDatasourceField, @@ -818,33 +818,36 @@ def _tableau_datasource_field_from_nested( _TABLEAU_DATASOURCE_FIELD_REL_FIELDS, TableauDatasourceFieldRelationshipAttributes, ) - return TableauDatasourceField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_datasource_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_datasource_field_attrs(attrs)) + kwargs.update(merged_rels) + return TableauDatasourceField(**kwargs) def _tableau_datasource_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/tableau_flow.py b/pyatlan_v9/model/assets/tableau_flow.py index 1dc43b54e..59eff4d75 100644 --- a/pyatlan_v9/model/assets/tableau_flow.py +++ b/pyatlan_v9/model/assets/tableau_flow.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import RelatedTableauFlow, RelatedTableauProject # ============================================================================= @@ -686,33 +686,36 @@ def _tableau_flow_from_nested(nested: TableauFlowNested) -> TableauFlow: _TABLEAU_FLOW_REL_FIELDS, TableauFlowRelationshipAttributes, ) - return TableauFlow( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_flow_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_flow_attrs(attrs)) + kwargs.update(merged_rels) + return TableauFlow(**kwargs) def _tableau_flow_to_nested_bytes(tableau_flow: TableauFlow, serde: Serde) -> bytes: @@ -729,10 +732,7 @@ def _tableau_flow_from_nested_bytes(data: bytes, serde: Serde) -> TableauFlow: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 TableauFlow.SITE_QUALIFIED_NAME = KeywordField("siteQualifiedName", "siteQualifiedName") TableauFlow.PROJECT_QUALIFIED_NAME = KeywordField( diff --git a/pyatlan_v9/model/assets/tableau_metric.py b/pyatlan_v9/model/assets/tableau_metric.py index bc685e8e6..fabb2291b 100644 --- a/pyatlan_v9/model/assets/tableau_metric.py +++ b/pyatlan_v9/model/assets/tableau_metric.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import RelatedTableauMetric, RelatedTableauProject # ============================================================================= @@ -663,33 +663,36 @@ def _tableau_metric_from_nested(nested: TableauMetricNested) -> TableauMetric: _TABLEAU_METRIC_REL_FIELDS, TableauMetricRelationshipAttributes, ) - return TableauMetric( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_metric_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_metric_attrs(attrs)) + kwargs.update(merged_rels) + return TableauMetric(**kwargs) def _tableau_metric_to_nested_bytes( @@ -708,10 +711,7 @@ def _tableau_metric_from_nested_bytes(data: bytes, serde: Serde) -> TableauMetri # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 TableauMetric.SITE_QUALIFIED_NAME = KeywordField( "siteQualifiedName", "siteQualifiedName" diff --git a/pyatlan_v9/model/assets/tableau_project.py b/pyatlan_v9/model/assets/tableau_project.py index cb8b27b2d..a514acc85 100644 --- a/pyatlan_v9/model/assets/tableau_project.py +++ b/pyatlan_v9/model/assets/tableau_project.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import ( RelatedTableauDatasource, RelatedTableauFlow, @@ -707,33 +707,36 @@ def _tableau_project_from_nested(nested: TableauProjectNested) -> TableauProject _TABLEAU_PROJECT_REL_FIELDS, TableauProjectRelationshipAttributes, ) - return TableauProject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_project_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_project_attrs(attrs)) + kwargs.update(merged_rels) + return TableauProject(**kwargs) def _tableau_project_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/tableau_site.py b/pyatlan_v9/model/assets/tableau_site.py index fff4ff028..85e8f08f8 100644 --- a/pyatlan_v9/model/assets/tableau_site.py +++ b/pyatlan_v9/model/assets/tableau_site.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import RelatedTableauProject, RelatedTableauSite # ============================================================================= @@ -604,33 +604,36 @@ def _tableau_site_from_nested(nested: TableauSiteNested) -> TableauSite: _TABLEAU_SITE_REL_FIELDS, TableauSiteRelationshipAttributes, ) - return TableauSite( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_site_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_site_attrs(attrs)) + kwargs.update(merged_rels) + return TableauSite(**kwargs) def _tableau_site_to_nested_bytes(tableau_site: TableauSite, serde: Serde) -> bytes: @@ -647,10 +650,7 @@ def _tableau_site_from_nested_bytes(data: bytes, serde: Serde) -> TableauSite: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 TableauSite.TABLEAU_PROJECT_HIERARCHY_QUALIFIED_NAMES = KeywordField( "tableauProjectHierarchyQualifiedNames", "tableauProjectHierarchyQualifiedNames" diff --git a/pyatlan_v9/model/assets/tableau_workbook.py b/pyatlan_v9/model/assets/tableau_workbook.py index df61f429d..899d35922 100644 --- a/pyatlan_v9/model/assets/tableau_workbook.py +++ b/pyatlan_v9/model/assets/tableau_workbook.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import ( RelatedTableauDashboard, RelatedTableauDatasource, @@ -708,33 +708,36 @@ def _tableau_workbook_from_nested(nested: TableauWorkbookNested) -> TableauWorkb _TABLEAU_WORKBOOK_REL_FIELDS, TableauWorkbookRelationshipAttributes, ) - return TableauWorkbook( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_workbook_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_workbook_attrs(attrs)) + kwargs.update(merged_rels) + return TableauWorkbook(**kwargs) def _tableau_workbook_to_nested_bytes( @@ -753,10 +756,7 @@ def _tableau_workbook_from_nested_bytes(data: bytes, serde: Serde) -> TableauWor # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 TableauWorkbook.SITE_QUALIFIED_NAME = KeywordField( "siteQualifiedName", "siteQualifiedName" diff --git a/pyatlan_v9/model/assets/tableau_worksheet.py b/pyatlan_v9/model/assets/tableau_worksheet.py index 94d839769..be2aab27d 100644 --- a/pyatlan_v9/model/assets/tableau_worksheet.py +++ b/pyatlan_v9/model/assets/tableau_worksheet.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import ( RelatedTableauCalculatedField, RelatedTableauDashboard, @@ -731,33 +731,36 @@ def _tableau_worksheet_from_nested(nested: TableauWorksheetNested) -> TableauWor _TABLEAU_WORKSHEET_REL_FIELDS, TableauWorksheetRelationshipAttributes, ) - return TableauWorksheet( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_worksheet_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_worksheet_attrs(attrs)) + kwargs.update(merged_rels) + return TableauWorksheet(**kwargs) def _tableau_worksheet_to_nested_bytes( @@ -776,10 +779,7 @@ def _tableau_worksheet_from_nested_bytes(data: bytes, serde: Serde) -> TableauWo # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 TableauWorksheet.SITE_QUALIFIED_NAME = KeywordField( "siteQualifiedName", "siteQualifiedName" diff --git a/pyatlan_v9/model/assets/tableau_worksheet_field.py b/pyatlan_v9/model/assets/tableau_worksheet_field.py index a0487b9f0..09c60d5a0 100644 --- a/pyatlan_v9/model/assets/tableau_worksheet_field.py +++ b/pyatlan_v9/model/assets/tableau_worksheet_field.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tableau_related import ( RelatedTableauCalculatedField, RelatedTableauDashboardField, @@ -865,33 +865,36 @@ def _tableau_worksheet_field_from_nested( _TABLEAU_WORKSHEET_FIELD_REL_FIELDS, TableauWorksheetFieldRelationshipAttributes, ) - return TableauWorksheetField( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tableau_worksheet_field_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tableau_worksheet_field_attrs(attrs)) + kwargs.update(merged_rels) + return TableauWorksheetField(**kwargs) def _tableau_worksheet_field_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/tag.py b/pyatlan_v9/model/assets/tag.py index 3eadcf8eb..59f68d035 100644 --- a/pyatlan_v9/model/assets/tag.py +++ b/pyatlan_v9/model/assets/tag.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .tag_related import RelatedTag # ============================================================================= @@ -609,33 +609,36 @@ def _tag_from_nested(nested: TagNested) -> Tag: _TAG_REL_FIELDS, TagRelationshipAttributes, ) - return Tag( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_tag_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_tag_attrs(attrs)) + kwargs.update(merged_rels) + return Tag(**kwargs) def _tag_to_nested_bytes(tag: Tag, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/task.py b/pyatlan_v9/model/assets/task.py index 00bd7a776..eb7435395 100644 --- a/pyatlan_v9/model/assets/task.py +++ b/pyatlan_v9/model/assets/task.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -41,13 +48,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .task_related import RelatedTask # ============================================================================= @@ -594,33 +594,36 @@ def _task_from_nested(nested: TaskNested) -> Task: _TASK_REL_FIELDS, TaskRelationshipAttributes, ) - return Task( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_task_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_task_attrs(attrs)) + kwargs.update(merged_rels) + return Task(**kwargs) def _task_to_nested_bytes(task: Task, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/thoughtspot.py b/pyatlan_v9/model/assets/thoughtspot.py index 4d26168e6..0cebc3bc3 100644 --- a/pyatlan_v9/model/assets/thoughtspot.py +++ b/pyatlan_v9/model/assets/thoughtspot.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .thoughtspot_related import RelatedThoughtspot # ============================================================================= @@ -608,33 +608,36 @@ def _thoughtspot_from_nested(nested: ThoughtspotNested) -> Thoughtspot: _THOUGHTSPOT_REL_FIELDS, ThoughtspotRelationshipAttributes, ) - return Thoughtspot( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_thoughtspot_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_thoughtspot_attrs(attrs)) + kwargs.update(merged_rels) + return Thoughtspot(**kwargs) def _thoughtspot_to_nested_bytes(thoughtspot: Thoughtspot, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/thoughtspot_answer.py b/pyatlan_v9/model/assets/thoughtspot_answer.py index bb8e88497..95a06dfa0 100644 --- a/pyatlan_v9/model/assets/thoughtspot_answer.py +++ b/pyatlan_v9/model/assets/thoughtspot_answer.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .thoughtspot_related import RelatedThoughtspotAnswer # ============================================================================= @@ -622,33 +622,36 @@ def _thoughtspot_answer_from_nested( _THOUGHTSPOT_ANSWER_REL_FIELDS, ThoughtspotAnswerRelationshipAttributes, ) - return ThoughtspotAnswer( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_thoughtspot_answer_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_thoughtspot_answer_attrs(attrs)) + kwargs.update(merged_rels) + return ThoughtspotAnswer(**kwargs) def _thoughtspot_answer_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/thoughtspot_column.py b/pyatlan_v9/model/assets/thoughtspot_column.py index 91ed0a73d..9ea3b80f8 100644 --- a/pyatlan_v9/model/assets/thoughtspot_column.py +++ b/pyatlan_v9/model/assets/thoughtspot_column.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .thoughtspot_related import ( RelatedThoughtspotColumn, RelatedThoughtspotTable, @@ -717,33 +717,36 @@ def _thoughtspot_column_from_nested( _THOUGHTSPOT_COLUMN_REL_FIELDS, ThoughtspotColumnRelationshipAttributes, ) - return ThoughtspotColumn( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_thoughtspot_column_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_thoughtspot_column_attrs(attrs)) + kwargs.update(merged_rels) + return ThoughtspotColumn(**kwargs) def _thoughtspot_column_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/thoughtspot_dashlet.py b/pyatlan_v9/model/assets/thoughtspot_dashlet.py index b6ec5c202..aba0145ad 100644 --- a/pyatlan_v9/model/assets/thoughtspot_dashlet.py +++ b/pyatlan_v9/model/assets/thoughtspot_dashlet.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .thoughtspot_related import RelatedThoughtspotDashlet, RelatedThoughtspotLiveboard # ============================================================================= @@ -671,33 +671,36 @@ def _thoughtspot_dashlet_from_nested( _THOUGHTSPOT_DASHLET_REL_FIELDS, ThoughtspotDashletRelationshipAttributes, ) - return ThoughtspotDashlet( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_thoughtspot_dashlet_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_thoughtspot_dashlet_attrs(attrs)) + kwargs.update(merged_rels) + return ThoughtspotDashlet(**kwargs) def _thoughtspot_dashlet_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/thoughtspot_liveboard.py b/pyatlan_v9/model/assets/thoughtspot_liveboard.py index 681a75d46..9634667dd 100644 --- a/pyatlan_v9/model/assets/thoughtspot_liveboard.py +++ b/pyatlan_v9/model/assets/thoughtspot_liveboard.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .thoughtspot_related import RelatedThoughtspotDashlet, RelatedThoughtspotLiveboard # ============================================================================= @@ -634,33 +634,36 @@ def _thoughtspot_liveboard_from_nested( _THOUGHTSPOT_LIVEBOARD_REL_FIELDS, ThoughtspotLiveboardRelationshipAttributes, ) - return ThoughtspotLiveboard( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_thoughtspot_liveboard_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_thoughtspot_liveboard_attrs(attrs)) + kwargs.update(merged_rels) + return ThoughtspotLiveboard(**kwargs) def _thoughtspot_liveboard_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/thoughtspot_table.py b/pyatlan_v9/model/assets/thoughtspot_table.py index b79f7ac22..4b908f37f 100644 --- a/pyatlan_v9/model/assets/thoughtspot_table.py +++ b/pyatlan_v9/model/assets/thoughtspot_table.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .thoughtspot_related import RelatedThoughtspotColumn, RelatedThoughtspotTable # ============================================================================= @@ -628,33 +628,36 @@ def _thoughtspot_table_from_nested(nested: ThoughtspotTableNested) -> Thoughtspo _THOUGHTSPOT_TABLE_REL_FIELDS, ThoughtspotTableRelationshipAttributes, ) - return ThoughtspotTable( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_thoughtspot_table_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_thoughtspot_table_attrs(attrs)) + kwargs.update(merged_rels) + return ThoughtspotTable(**kwargs) def _thoughtspot_table_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/thoughtspot_view.py b/pyatlan_v9/model/assets/thoughtspot_view.py index 1a9eef90e..dd03c396f 100644 --- a/pyatlan_v9/model/assets/thoughtspot_view.py +++ b/pyatlan_v9/model/assets/thoughtspot_view.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .thoughtspot_related import RelatedThoughtspotColumn, RelatedThoughtspotView # ============================================================================= @@ -628,33 +628,36 @@ def _thoughtspot_view_from_nested(nested: ThoughtspotViewNested) -> ThoughtspotV _THOUGHTSPOT_VIEW_REL_FIELDS, ThoughtspotViewRelationshipAttributes, ) - return ThoughtspotView( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_thoughtspot_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_thoughtspot_view_attrs(attrs)) + kwargs.update(merged_rels) + return ThoughtspotView(**kwargs) def _thoughtspot_view_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/thoughtspot_worksheet.py b/pyatlan_v9/model/assets/thoughtspot_worksheet.py index a41cdc3bf..631f42dfa 100644 --- a/pyatlan_v9/model/assets/thoughtspot_worksheet.py +++ b/pyatlan_v9/model/assets/thoughtspot_worksheet.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .thoughtspot_related import RelatedThoughtspotColumn, RelatedThoughtspotWorksheet # ============================================================================= @@ -630,33 +630,36 @@ def _thoughtspot_worksheet_from_nested( _THOUGHTSPOT_WORKSHEET_REL_FIELDS, ThoughtspotWorksheetRelationshipAttributes, ) - return ThoughtspotWorksheet( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_thoughtspot_worksheet_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_thoughtspot_worksheet_attrs(attrs)) + kwargs.update(merged_rels) + return ThoughtspotWorksheet(**kwargs) def _thoughtspot_worksheet_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/unstructured.py b/pyatlan_v9/model/assets/unstructured.py index a74fc8d46..71629b84c 100644 --- a/pyatlan_v9/model/assets/unstructured.py +++ b/pyatlan_v9/model/assets/unstructured.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .unstructured_related import RelatedUnstructured # ============================================================================= @@ -622,33 +622,36 @@ def _unstructured_from_nested(nested: UnstructuredNested) -> Unstructured: _UNSTRUCTURED_REL_FIELDS, UnstructuredRelationshipAttributes, ) - return Unstructured( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_unstructured_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_unstructured_attrs(attrs)) + kwargs.update(merged_rels) + return Unstructured(**kwargs) def _unstructured_to_nested_bytes(unstructured: Unstructured, serde: Serde) -> bytes: @@ -665,10 +668,7 @@ def _unstructured_from_nested_bytes(data: bytes, serde: Serde) -> Unstructured: # --------------------------------------------------------------------------- # Deferred field descriptor initialization # --------------------------------------------------------------------------- -from pyatlan.model.fields.atlan_fields import ( # noqa: E402 - KeywordField, - RelationField, -) +from pyatlan.model.fields.atlan_fields import KeywordField, RelationField # noqa: E402 Unstructured.UNSTRUCTURED_CONTAINER_NAME = KeywordField( "unstructuredContainerName", "unstructuredContainerName" diff --git a/pyatlan_v9/model/assets/unstructured_container.py b/pyatlan_v9/model/assets/unstructured_container.py index ca08f142d..2d6b7a7ab 100644 --- a/pyatlan_v9/model/assets/unstructured_container.py +++ b/pyatlan_v9/model/assets/unstructured_container.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -46,13 +53,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .unstructured_related import ( RelatedUnstructuredContainer, RelatedUnstructuredFolder, @@ -678,33 +678,36 @@ def _unstructured_container_from_nested( _UNSTRUCTURED_CONTAINER_REL_FIELDS, UnstructuredContainerRelationshipAttributes, ) - return UnstructuredContainer( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_unstructured_container_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_unstructured_container_attrs(attrs)) + kwargs.update(merged_rels) + return UnstructuredContainer(**kwargs) def _unstructured_container_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/unstructured_folder.py b/pyatlan_v9/model/assets/unstructured_folder.py index 49402a60c..f9026d366 100644 --- a/pyatlan_v9/model/assets/unstructured_folder.py +++ b/pyatlan_v9/model/assets/unstructured_folder.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .unstructured_related import ( RelatedUnstructuredContainer, RelatedUnstructuredFolder, @@ -715,33 +715,36 @@ def _unstructured_folder_from_nested( _UNSTRUCTURED_FOLDER_REL_FIELDS, UnstructuredFolderRelationshipAttributes, ) - return UnstructuredFolder( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_unstructured_folder_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_unstructured_folder_attrs(attrs)) + kwargs.update(merged_rels) + return UnstructuredFolder(**kwargs) def _unstructured_folder_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/unstructured_object.py b/pyatlan_v9/model/assets/unstructured_object.py index 81ca06752..f48317094 100644 --- a/pyatlan_v9/model/assets/unstructured_object.py +++ b/pyatlan_v9/model/assets/unstructured_object.py @@ -19,6 +19,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -47,13 +54,6 @@ from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck from .spark_related import RelatedSparkJob -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .unstructured_related import ( RelatedUnstructuredContainer, RelatedUnstructuredFolder, @@ -722,33 +722,36 @@ def _unstructured_object_from_nested( _UNSTRUCTURED_OBJECT_REL_FIELDS, UnstructuredObjectRelationshipAttributes, ) - return UnstructuredObject( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_unstructured_object_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_unstructured_object_attrs(attrs)) + kwargs.update(merged_rels) + return UnstructuredObject(**kwargs) def _unstructured_object_to_nested_bytes( diff --git a/pyatlan_v9/model/assets/view.py b/pyatlan_v9/model/assets/view.py index 1b5840873..041a2d738 100644 --- a/pyatlan_v9/model/assets/view.py +++ b/pyatlan_v9/model/assets/view.py @@ -20,6 +20,14 @@ import msgspec from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset +from pyatlan_v9.utils import init_guid, validate_required_fields + from .airflow_related import RelatedAirflowTask from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField @@ -59,14 +67,6 @@ RelatedSqlInsightBusinessQuestion, RelatedSqlInsightJoin, ) -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset -from pyatlan_v9.utils import init_guid, validate_required_fields - from .sql_related import RelatedColumn, RelatedQuery, RelatedSchema, RelatedView # ============================================================================= @@ -1213,33 +1213,36 @@ def _view_from_nested(nested: ViewNested) -> View: _VIEW_REL_FIELDS, ViewRelationshipAttributes, ) - return View( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_view_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_view_attrs(attrs)) + kwargs.update(merged_rels) + return View(**kwargs) def _view_to_nested_bytes(view: View, serde: Serde) -> bytes: diff --git a/pyatlan_v9/model/assets/workflow.py b/pyatlan_v9/model/assets/workflow.py index 260dc7b13..645277d9f 100644 --- a/pyatlan_v9/model/assets/workflow.py +++ b/pyatlan_v9/model/assets/workflow.py @@ -18,6 +18,13 @@ from msgspec import UNSET, UnsetType +from pyatlan_v9.model.conversion_utils import ( + categorize_relationships, + merge_relationships, +) +from pyatlan_v9.model.serde import Serde, get_serde +from pyatlan_v9.model.transform import register_asset + from .anomalo_related import RelatedAnomaloCheck from .app_related import RelatedApplication, RelatedApplicationField from .asset import ( @@ -41,13 +48,6 @@ from .resource_related import RelatedFile, RelatedLink, RelatedReadme from .schema_registry_related import RelatedSchemaRegistrySubject from .soda_related import RelatedSodaCheck -from pyatlan_v9.model.conversion_utils import ( - categorize_relationships, - merge_relationships, -) -from pyatlan_v9.model.serde import Serde, get_serde -from pyatlan_v9.model.transform import register_asset - from .workflow_related import RelatedWorkflow # ============================================================================= @@ -555,33 +555,36 @@ def _workflow_from_nested(nested: WorkflowNested) -> Workflow: _WORKFLOW_REL_FIELDS, WorkflowRelationshipAttributes, ) - return Workflow( - guid=nested.guid, - type_name=nested.type_name, - status=nested.status, - version=nested.version, - create_time=nested.create_time, - update_time=nested.update_time, - created_by=nested.created_by, - updated_by=nested.updated_by, - classifications=nested.classifications, - classification_names=nested.classification_names, - meanings=nested.meanings, - labels=nested.labels, - business_attributes=nested.business_attributes, - custom_attributes=nested.custom_attributes, - pending_tasks=nested.pending_tasks, - proxy=nested.proxy, - is_incomplete=nested.is_incomplete, - provenance_type=nested.provenance_type, - home_id=nested.home_id, - depth=nested.depth, - immediate_upstream=nested.immediate_upstream, - immediate_downstream=nested.immediate_downstream, - **_extract_workflow_attrs(attrs), - # Merged relationship attributes - **merged_rels, - ) + # Build kwargs so a field carried by both the top level and the merged + # relationships (e.g. `meanings`) is passed once, with the relationship + # value winning — otherwise the constructor gets a duplicate keyword. + kwargs = { + "guid": nested.guid, + "type_name": nested.type_name, + "status": nested.status, + "version": nested.version, + "create_time": nested.create_time, + "update_time": nested.update_time, + "created_by": nested.created_by, + "updated_by": nested.updated_by, + "classifications": nested.classifications, + "classification_names": nested.classification_names, + "meanings": nested.meanings, + "labels": nested.labels, + "business_attributes": nested.business_attributes, + "custom_attributes": nested.custom_attributes, + "pending_tasks": nested.pending_tasks, + "proxy": nested.proxy, + "is_incomplete": nested.is_incomplete, + "provenance_type": nested.provenance_type, + "home_id": nested.home_id, + "depth": nested.depth, + "immediate_upstream": nested.immediate_upstream, + "immediate_downstream": nested.immediate_downstream, + } + kwargs.update(_extract_workflow_attrs(attrs)) + kwargs.update(merged_rels) + return Workflow(**kwargs) def _workflow_to_nested_bytes(workflow: Workflow, serde: Serde) -> bytes: diff --git a/requirements.txt b/requirements.txt index 0865144a7..e69de29bb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,304 +0,0 @@ -# This file was autogenerated by uv via the following command: -# uv export --all-extras --no-hashes --e . -annotated-types==0.7.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pydantic -anyio==4.12.1 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via httpx -ast-serialize==0.6.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via mypy -authlib==1.6.9 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via pyatlan -authlib==1.7.2 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pyatlan -backports-asyncio-runner==1.2.0 ; python_full_version < '3.11' and platform_python_implementation == 'CPython' - # via pytest-asyncio -backports-tarfile==1.2.0 ; python_full_version < '3.12' and platform_python_implementation == 'CPython' - # via jaraco-context -cachebox==5.2.3 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via deepdiff -certifi==2026.2.25 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # httpcore - # httpx - # requests -cffi==2.0.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via cryptography -cfgv==3.4.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via pre-commit -cfgv==3.5.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pre-commit -charset-normalizer==3.4.5 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via requests -colorama==0.4.6 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' and sys_platform == 'win32' - # via pytest -coverage==7.10.7 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via pytest-cov -coverage==7.13.4 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pytest-cov -cryptography==50.0.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # authlib - # joserfc - # secretstorage - # types-authlib -deepdiff==8.6.1 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' -deepdiff==9.1.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' -distlib==0.4.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via virtualenv -docutils==0.21.2 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via readme-renderer -exceptiongroup==1.3.1 ; python_full_version < '3.11' and platform_python_implementation == 'CPython' - # via - # anyio - # pytest -filelock==3.19.1 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via - # python-discovery - # virtualenv -filelock==3.32.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # python-discovery - # virtualenv -h11==0.16.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via httpcore -httpcore==1.0.9 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via httpx -httpx==0.28.1 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # httpx-retries - # pyatlan -httpx-retries==0.4.6 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via pyatlan -httpx-retries==0.6.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pyatlan -id==1.5.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via twine -id==1.6.1 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via twine -identify==2.6.15 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via pre-commit -identify==2.6.17 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pre-commit -idna==3.11 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # anyio - # httpx - # requests - # yarl -importlib-metadata==8.7.1 ; (python_full_version < '3.12' and platform_machine != 'ppc64le' and platform_machine != 's390x' and platform_python_implementation == 'CPython') or (python_full_version < '3.10' and platform_machine == 'ppc64le' and platform_python_implementation == 'CPython') or (python_full_version < '3.10' and platform_machine == 's390x' and platform_python_implementation == 'CPython') - # via - # keyring - # twine -iniconfig==2.1.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via pytest -iniconfig==2.3.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pytest -jaraco-classes==3.4.0 ; python_full_version < '3.15' and platform_machine != 'ppc64le' and platform_machine != 's390x' and platform_python_implementation == 'CPython' - # via keyring -jaraco-context==6.1.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via keyring -jaraco-functools==4.4.0 ; python_full_version < '3.15' and platform_machine != 'ppc64le' and platform_machine != 's390x' and platform_python_implementation == 'CPython' - # via keyring -jeepney==0.9.0 ; python_full_version < '3.15' and platform_machine != 'ppc64le' and platform_machine != 's390x' and platform_python_implementation == 'CPython' and sys_platform == 'linux' - # via - # keyring - # secretstorage -jinja2==3.1.6 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pyatlan -joserfc==1.7.4 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via authlib -keyring==25.7.0 ; python_full_version < '3.15' and platform_machine != 'ppc64le' and platform_machine != 's390x' and platform_python_implementation == 'CPython' - # via twine -lazy-loader==0.5 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pyatlan -librt==0.8.1 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via mypy -librt==0.13.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via mypy -markdown-it-py==3.0.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via rich -markdown-it-py==4.0.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via rich -markupsafe==3.0.3 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via jinja2 -mdurl==0.1.2 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via markdown-it-py -more-itertools==10.8.0 ; python_full_version < '3.15' and platform_machine != 'ppc64le' and platform_machine != 's390x' and platform_python_implementation == 'CPython' - # via - # jaraco-classes - # jaraco-functools -msgspec==0.20.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via pyatlan -msgspec==0.21.1 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pyatlan -multidict==6.7.1 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via yarl -mypy==1.19.1 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' -mypy==2.3.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' -mypy-extensions==1.1.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via mypy -nanoid==2.0.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pyatlan -networkx==3.2.1 ; python_full_version < '3.11' and platform_python_implementation == 'CPython' - # via networkx-stubs -networkx==3.6.1 ; python_full_version >= '3.11' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via networkx-stubs -networkx-stubs==0.0.1 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' -nh3==0.3.3 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via readme-renderer -nodeenv==1.10.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pre-commit -orderly-set==5.5.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via deepdiff -packaging==26.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # lazy-loader - # pytest - # twine -pathspec==1.0.4 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via mypy -platformdirs==4.4.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via - # python-discovery - # virtualenv -platformdirs==4.9.4 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # python-discovery - # virtualenv -pluggy==1.6.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # pytest - # pytest-cov -pre-commit==4.3.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' -pre-commit==4.6.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' -propcache==0.4.1 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via yarl -pycparser==2.23 ; python_full_version < '3.10' and implementation_name != 'PyPy' and platform_python_implementation == 'CPython' - # via cffi -pycparser==3.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and implementation_name != 'PyPy' and platform_python_implementation == 'CPython' - # via cffi -pydantic==2.13.4 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pyatlan -pydantic-core==2.46.4 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pydantic -pygments==2.19.2 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # pytest - # readme-renderer - # rich -pytest==8.4.2 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via - # pytest-asyncio - # pytest-cov - # pytest-order - # pytest-sugar - # pytest-timer - # pytest-vcr -pytest==9.1.1 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # pytest-asyncio - # pytest-cov - # pytest-order - # pytest-sugar - # pytest-timer - # pytest-vcr -pytest-asyncio==1.2.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' -pytest-asyncio==1.4.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' -pytest-cov==7.1.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' -pytest-order==1.5.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' -pytest-sugar==1.1.1 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' -pytest-timer==1.0.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' -pytest-vcr==1.0.2 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' -python-dateutil==2.9.0.post0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pyatlan -python-discovery==1.5.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via virtualenv -pytz==2026.2 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pyatlan -pywin32-ctypes==0.2.3 ; python_full_version < '3.15' and platform_machine != 'ppc64le' and platform_machine != 's390x' and platform_python_implementation == 'CPython' and sys_platform == 'win32' - # via keyring -pyyaml==6.0.3 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # pre-commit - # pyatlan - # vcrpy -readme-renderer==44.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via twine -requests==2.32.5 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # id - # requests-toolbelt - # twine -requests-toolbelt==1.0.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via twine -rfc3986==2.0.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via twine -rich==14.3.3 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via twine -ruff==0.15.22 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' -secretstorage==3.3.3 ; python_full_version < '3.10' and platform_machine != 'ppc64le' and platform_machine != 's390x' and platform_python_implementation == 'CPython' and sys_platform == 'linux' - # via keyring -secretstorage==3.5.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_machine != 'ppc64le' and platform_machine != 's390x' and platform_python_implementation == 'CPython' and sys_platform == 'linux' - # via keyring -six==1.17.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via python-dateutil -tenacity==9.1.2 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via pyatlan -tenacity==9.1.4 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pyatlan -termcolor==3.1.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via - # pytest-sugar - # pytest-timer -termcolor==3.3.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # pytest-sugar - # pytest-timer -tomli==2.4.0 ; python_full_version <= '3.11' and platform_python_implementation == 'CPython' - # via - # coverage - # mypy - # pytest -twine==6.2.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' -types-authlib==1.6.7.20260208 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' -types-authlib==1.6.11.20260518 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' -types-retry==0.9.9.20250322 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' -types-setuptools==81.0.0.20260209 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' -types-setuptools==83.0.0.20260716 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' -typing-extensions==4.15.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # anyio - # cryptography - # exceptiongroup - # multidict - # mypy - # pydantic - # pydantic-core - # pytest-asyncio - # typing-inspection - # virtualenv -typing-inspection==0.4.2 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pydantic -urllib3==1.26.20 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via - # requests - # twine - # vcrpy -urllib3==2.7.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via - # id - # requests - # twine -vcrpy==7.0.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via pytest-vcr -vcrpy==8.3.0 ; python_full_version >= '3.10' and python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pytest-vcr -virtualenv==21.7.0 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via pre-commit -wrapt==2.1.2 ; python_full_version < '3.15' and platform_python_implementation == 'CPython' - # via vcrpy -yarl==1.22.0 ; python_full_version < '3.10' and platform_python_implementation == 'CPython' - # via vcrpy -zipp==3.23.0 ; (python_full_version < '3.12' and platform_machine != 'ppc64le' and platform_machine != 's390x' and platform_python_implementation == 'CPython') or (python_full_version < '3.10' and platform_machine == 'ppc64le' and platform_python_implementation == 'CPython') or (python_full_version < '3.10' and platform_machine == 's390x' and platform_python_implementation == 'CPython') - # via importlib-metadata diff --git a/tests/integration/aio/test_client.py b/tests/integration/aio/test_client.py index cd5f1ad19..82546c937 100644 --- a/tests/integration/aio/test_client.py +++ b/tests/integration/aio/test_client.py @@ -29,8 +29,8 @@ AtlasGlossaryTerm, Connection, Database, - KnowledgeFile, DataContract, + KnowledgeFile, Schema, Table, ) diff --git a/tests/integration/test_app_client.py b/tests/integration/test_app_client.py index 6ac3266de..bcf6888aa 100644 --- a/tests/integration/test_app_client.py +++ b/tests/integration/test_app_client.py @@ -21,11 +21,7 @@ from pyatlan.client.atlan import AtlanClient from pyatlan.errors import AtlanError -from pyatlan.model.app import ( - AppInfo, - AppInputContract, - AppResponse, -) +from pyatlan.model.app import AppInfo, AppInputContract, AppResponse from pyatlan.model.apps import BigqueryCrawler, BigqueryCrawlerInputs from tests.integration.client import TestId diff --git a/tests/unit/test_app_client.py b/tests/unit/test_app_client.py index b984c8a63..157788d0a 100644 --- a/tests/unit/test_app_client.py +++ b/tests/unit/test_app_client.py @@ -11,13 +11,11 @@ import httpx import pytest -from pyatlan.client.transport import PyatlanSyncTransport - from pyatlan.client.aio.app import AsyncAppClient from pyatlan.client.app import _APP_NO_500_RETRY, AppClient from pyatlan.client.common import ApiCaller, AsyncApiCaller +from pyatlan.client.transport import PyatlanSyncTransport from pyatlan.errors import AtlanError -from pyatlan.model.assets import AppWorkflowRun from pyatlan.model.app import ( AppDeleteResponse, AppInfo, @@ -29,6 +27,7 @@ AppScheduleResponse, AppSummary, ) +from pyatlan.model.assets import AppWorkflowRun @pytest.fixture diff --git a/tests/unit/test_core.py b/tests/unit/test_core.py index 214b59f77..fd43c33cc 100644 --- a/tests/unit/test_core.py +++ b/tests/unit/test_core.py @@ -1,7 +1,6 @@ from __future__ import annotations import json - from typing import no_type_check from unittest.mock import MagicMock