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/druid) Handling gracefully if no table returned in a schema #8203

Merged
merged 5 commits into from
Jun 15, 2023

Conversation

treff7es
Copy link
Contributor

@treff7es treff7es commented Jun 9, 2023

  • Handling gracefully if no table returned in a schema
  • Adding view schema to the default deny

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

Adding `view` schema to the default deny
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Jun 9, 2023
)

result = connection.execute(text(query))
return [row.TABLE_NAME for row in result] if result.rowcount > 0 else []
Copy link
Collaborator

Choose a reason for hiding this comment

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

What exactly is this result.rowcount > 0 check doing? Does sqlalchemy normally error if the row count is 0?

Copy link
Contributor Author

@treff7es treff7es Jun 9, 2023

Choose a reason for hiding this comment

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

I threw an error (This result object does not return rows. It has been closed automatically.) if no rows were returned and it tried to iterate over the results.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems like a druid sqlalchemy bug to me... or something that should be configurable. Why would returning no rows result in an error?

Would at least prefer if we referenced the existing code (e.g. wrapped with a try catch) rather than overwriting it, if possible

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.

3 participants