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): automated term classification for snowflake #6376

Merged
merged 17 commits into from Nov 23, 2022

Conversation

mayurinehate
Copy link
Collaborator

@mayurinehate mayurinehate commented Nov 7, 2022

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 Nov 7, 2022
@github-actions
Copy link

github-actions bot commented Nov 7, 2022

Unit Test Results (metadata ingestion)

       8 files  ±0         8 suites  ±0   57m 13s ⏱️ -26s
   764 tests +3     761 ✔️ +3  3 💤 ±0  0 ±0 
1 530 runs  +6  1 523 ✔️ +6  7 💤 ±0  0 ±0 

Results for commit 15ed4f7. ± Comparison against base commit 10a31b1.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

Unit Test Results (build & test)

621 tests  ±0   617 ✔️ ±0   15m 51s ⏱️ -18s
157 suites ±0       4 💤 ±0 
157 files   ±0       0 ±0 

Results for commit 15ed4f7. ± Comparison against base commit 10a31b1.

♻️ This comment has been updated with latest results.

@mayurinehate mayurinehate marked this pull request as ready for review November 8, 2022 17:16
@hsheth2 hsheth2 changed the title feat(classification): add support for automated glossary term detecti… feat(classification): automated glossary term detection in snowflake Nov 21, 2022
@@ -3,6 +3,7 @@
from datetime import datetime
from typing import Dict, List, Optional

import pandas as pd
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: this should be a typing-only dep - see mypy's docs on TYPE_CHECKING

Copy link
Collaborator

Choose a reason for hiding this comment

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

also I believe this PR acryldata/datahub-classify#6 is going to remove the pandas dep from datahub-classify

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are using pandas to read from snowflake cursor and translate to pandas dataframe in snowflake- https://docs.snowflake.com/en/user-guide/python-connector-pandas.html#migrating-to-pandas-dataframes. so this is required dependency for snowflake connector. I am not sure how converting this to typing-only dep will be useful.

Copy link
Collaborator

Choose a reason for hiding this comment

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

got it - in this case it's fine then, but I don't want to have a hard dep on pandas when we add classification to other sources

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense. I believe that would need refractor in classification_mixin as well. Maybe, we can replace sample_data input param with a callable function that takes column as input and returns list-like values structure as output ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, although I suspect a dict {column name -> list[sample values]} is good enough for this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

seems fair.

# Ideally we do not want null values in sample data for a column.
# However that would require separate query per column and
# that would be expensive, hence not done.
def get_sample_values_for_table(self, conn, table_name, schema_name, db_name):
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this repeat work that the profiler does?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Kind of, but not exactly. With current implementation(with GE), profile can get only limited number of sample values(upto 20).

@hsheth2 hsheth2 changed the title feat(classification): automated glossary term detection in snowflake feat(ingest): automated term classification for snowflake Nov 23, 2022
@hsheth2 hsheth2 merged commit 22847a9 into datahub-project:master Nov 23, 2022
cccs-Dustin pushed a commit to CybercentreCanada/datahub that referenced this pull request Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants