Skip to content

Commit

Permalink
type failures fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
eesanoble committed May 23, 2024
1 parent 9e42cb4 commit 9ea7f45
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,8 @@ def create_dbt_platform_mces(
id=platform_instance_urn, urn=platform_instance_urn
)
)
browse_paths_v2_path.append(BrowsePathEntryClass(id=node.schema))
if node.schema:
browse_paths_v2_path.append(BrowsePathEntryClass(id=node.schema))
aspects.append(BrowsePathsV2Class(path=browse_paths_v2_path))

if len(aspects) == 0:
Expand Down Expand Up @@ -1596,7 +1597,7 @@ def get_schema_metadata(
description=description,
default_nullable=True,
custom_tags=column.tags,
**meta_mapping_args,
**meta_mapping_args, # type: ignore
)
assert schema_fields
canonical_schema.extend(schema_fields)
Expand Down
12 changes: 8 additions & 4 deletions metadata-ingestion/src/datahub/ingestion/source/tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,7 @@ def parse_custom_sql(
)
return None

query = clean_query(datasource.get(c.QUERY))
query = clean_query(datasource.get(c.QUERY, ""))
if query is None:
logger.debug(
f"raw sql query is not available for datasource {datasource_urn}"
Expand Down Expand Up @@ -2218,11 +2218,15 @@ def emit_table(

# Browse path V2
platform = get_dataset_platform_from_urn(database_table.urn)
platform_instance = self.config.platform_instance_map.get(
platform, self.config.platform_instance
platform_instance = (
self.config.platform_instance_map.get(
platform, self.config.platform_instance
)
if self.config.platform_instance_map and platform
else None
)
browse_paths_V2_path = []
if platform_instance:
if platform_instance and platform:
platform_instance_urn = builder.make_dataplatform_instance_urn(
platform, platform_instance
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ def get_schema_fields_for_hive_column(
avro_schema_json = get_avro_schema_for_hive_column(
hive_column_name=hive_column_name, hive_column_type=hive_column_type
)
if meta_props:
if meta_props and isinstance(avro_schema_json, dict):
avro_schema_json.update(meta_props)

schema_tag_args = {}
if custom_tags:
if custom_tags and isinstance(avro_schema_json, dict):
schema_tag_args["schema_tags_field"] = "custom_tags"
# tag_prefix is required if passing schema_tags_field
schema_tag_args["tag_prefix"] = ""
Expand All @@ -286,7 +286,7 @@ def get_schema_fields_for_hive_column(
default_nullable=default_nullable,
swallow_exceptions=False,
meta_mapping_processor=meta_mapping_processor,
**schema_tag_args,
**schema_tag_args, # type: ignore
)
except Exception as e:
logger.warning(
Expand Down

0 comments on commit 9ea7f45

Please sign in to comment.