Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ingest/tableau): Allow parsing of database name from fullName #8981

Merged

Conversation

asikowitz
Copy link
Collaborator

@asikowitz asikowitz commented Oct 10, 2023

I recognize this is a decent refactor, but I didn't want to keep contributing to this scattered urn generation process. This is meant to replicate existing behavior, aside from adding the ability to parse [database].[schema].[table] from fullName. Also now parses table name from [schema].[table], when it used to only parse the schema name

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Oct 10, 2023
@@ -605,43 +711,16 @@ def get_overridden_info(
):
upstream_db = lineage_overrides.database_override_map[upstream_db]

platform_instance = get_platform_instance(original_platform, platform_instance_map)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this method in favor of this one line statement


return full_name.replace("[", "").replace("]", "").split(".")

def make_dataset_urn(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically copied from make_table_urn

connection_type: str

@classmethod
def create(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant to replicate logic in get_upstream_tables. Pulls values out of table dict, parses schema from full_name and default_schema_map (and now parses database too), and does this schema in table check for redshift

@@ -537,12 +542,12 @@ def get_fully_qualified_table_name(
platform: str,
upstream_db: str,
schema: str,
full_name: str,
table_name: str,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was never passed full_name...:

            table_urn = make_table_urn(
                self.config.env,
                upstream_db,
                table.get(tableau_constant.CONNECTION_TYPE) or "",
                schema,
                table_name,
                self.config.platform_instance_map,
                self.config.lineage_overrides,
            )
	```
5th argument is clearly `table_name`, not `full_name`

@@ -2462,35 +2437,6 @@ def emit_embedded_datasources(self) -> Iterable[MetadataWorkUnit]:
is_embedded_ds=True,
)

@lru_cache(maxsize=None)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I lose the lru_cache capabilities, but I don't think that matters... these are such simple and quick operations

Copy link
Collaborator

@hsheth2 hsheth2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully follow the logic here, but seems reasonable

@asikowitz
Copy link
Collaborator Author

Merging before smoke tests to create release

@asikowitz asikowitz merged commit 1a72fa4 into datahub-project:master Oct 10, 2023
52 of 54 checks passed
@asikowitz asikowitz deleted the tableau-lineage-handle-database branch October 10, 2023 21:34
@maggiehays maggiehays added the hacktoberfest-accepted Acceptance for hacktoberfest https://hacktoberfest.com/participation/ label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Acceptance for hacktoberfest https://hacktoberfest.com/participation/ ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants