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

fix(ingest) Athena: db filter was not applied #4127

Merged
merged 4 commits into from
Feb 11, 2022

Conversation

treff7es
Copy link
Contributor

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)

@@ -33,10 +33,22 @@ def get_sql_alchemy_url(self):


class AthenaSource(SQLAlchemySource):
config: AthenaConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete this. The config is already an instance member of SQLAlchemySource, and will get correctly initialized via lines 44->39.

@treff7es treff7es changed the title fix(ingest) Athena: Db filter was not applied fix(ingest) Athena: db filter was not applied Feb 11, 2022
def __init__(self, config, ctx):
super().__init__(config, ctx, "athena")

@classmethod
def create(cls, config_dict, ctx):
config = AthenaConfig.parse_obj(config_dict)
return cls(config, ctx)

# It seems like database/schema filter in the connection string does not work and this to work around that
def get_schema_names(self, inspector):
Copy link
Contributor

Choose a reason for hiding this comment

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

missing return type annotation.

def get_schema_names(self, inspector):
schemas = inspector.get_schema_names()
if self.config.database:
for schema in schemas:
Copy link
Contributor

Choose a reason for hiding this comment

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

50-53

return [schema in schemas if schema == self.config.database]

Copy link
Contributor

@rslanka rslanka left a comment

Choose a reason for hiding this comment

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

Needs changes.

@github-actions
Copy link

github-actions bot commented Feb 11, 2022

Unit Test Results (build & test)

  69 files   -   1    69 suites   - 1   5m 50s ⏱️ - 6m 54s
540 tests  - 69  488 ✔️  - 62  52 💤  - 7  0 ±0 

Results for commit ff55815. ± Comparison against base commit 7fcc71e.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Feb 11, 2022

Unit Test Results (metadata ingestion)

    3 files  ±0      3 suites  ±0   42m 37s ⏱️ + 5m 12s
311 tests ±0  311 ✔️ ±0    0 💤 ±0  0 ±0 
893 runs  ±0  866 ✔️  - 7  27 💤 +7  0 ±0 

Results for commit ff55815. ± Comparison against base commit 7fcc71e.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@rslanka rslanka left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

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

LGTM

@shirshanka shirshanka merged commit d24c528 into datahub-project:master Feb 11, 2022
ne1r0n pushed a commit to ne1r0n/datahub that referenced this pull request Feb 13, 2022
* Fix for db filter on Athena

* Black formatting

* Addressing pr comments

* Remove unneeded imports
hevandro-veiga pushed a commit to hevandro-veiga/datahub that referenced this pull request Feb 18, 2022
* Fix for db filter on Athena

* Black formatting

* Addressing pr comments

* Remove unneeded imports
maggiehays pushed a commit to maggiehays/datahub that referenced this pull request Aug 1, 2022
* Fix for db filter on Athena

* Black formatting

* Addressing pr comments

* Remove unneeded imports
@treff7es treff7es deleted the athena_db_filter_fix branch February 8, 2023 11:55
@treff7es treff7es restored the athena_db_filter_fix branch February 22, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants