Skip to content

[TASK-6140] Add OMeta header to SQLAlchemy-based queries - #6293

Merged
pmbrull merged 6 commits into
open-metadata:mainfrom
Beetelbrox:TASK-6140-add-comment-to-ometa-queries
Jul 23, 2022
Merged

pmbrull merged 6 commits into
open-metadata:mainfrom
Beetelbrox:TASK-6140-add-comment-to-ometa-queries

Conversation

@Beetelbrox

@Beetelbrox Beetelbrox commented Jul 22, 2022 •

Copy link
Copy Markdown
Contributor

#6140

Describe your changes :

We wanted to add a header to all openmetadata queries in order to identify & filter them. We've achieved that by using SQLAlchemy's event listeners to intercept and alter all statements from the engine in CommonDbSourceService. Seem to work on the inspector when inspecting connections derived from the same engine too. Example query extracted from the Redshift's system tables:

image

We've also filtered all queries with the OpenMetadata & dbt headers as per the issue.

I only have access for a working setup of Redshift so we as we've modified several queries for other systems if we have some battery of integration tests it would be safer to run them.

Type of change :

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Frontend Preview (Screenshots) :

N/A

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • All new and existing tests passed.

Reviewers

@open-metadata/ingestion

@Beetelbrox
Beetelbrox temporarily deployed to cypress July 22, 2022 22:45 Inactive
@Beetelbrox
Beetelbrox temporarily deployed to cypress July 22, 2022 22:45 Inactive
@Beetelbrox Beetelbrox changed the title [TASK-6140] Add OMeta header to queries [TASK-6140] Add OMeta header to SQLAlchemy-based queries Jul 22, 2022
@Beetelbrox
Beetelbrox temporarily deployed to cypress July 22, 2022 22:48 Inactive
@Beetelbrox
Beetelbrox temporarily deployed to cypress July 22, 2022 22:48 Inactive
@cypress

cypress Bot commented Jul 22, 2022 •

Copy link
Copy Markdown



Test summary

47 • 0 • 3 • 0


Run details

Project openmetadata
Status Passed
Commit bd3986f
Started Jul 23, 2022 8:08 AM
Ended Jul 23, 2022 8:19 AM
Duration 10:43 💡
OS Linux Ubuntu - 20.04
Browser Chrome 103

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@Beetelbrox
Beetelbrox temporarily deployed to cypress July 23, 2022 06:09 Inactive
@Beetelbrox
Beetelbrox temporarily deployed to cypress July 23, 2022 06:09 Inactive
@Beetelbrox
Beetelbrox temporarily deployed to cypress July 23, 2022 06:15 Inactive
@Beetelbrox
Beetelbrox temporarily deployed to cypress July 23, 2022 06:15 Inactive
@Beetelbrox
Beetelbrox temporarily deployed to cypress July 23, 2022 06:27 Inactive
@Beetelbrox
Beetelbrox temporarily deployed to cypress July 23, 2022 06:27 Inactive
@Beetelbrox
Beetelbrox temporarily deployed to cypress July 23, 2022 07:47 Inactive
@Beetelbrox
Beetelbrox temporarily deployed to cypress July 23, 2022 07:47 Inactive
@sonarqubecloud

Copy link
Copy Markdown

[open-metadata-ingestion] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@pmbrull pmbrull left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is great, many thanks @Beetelbrox

@pmbrull
pmbrull merged commit 78dd44e into open-metadata:main Jul 23, 2022
pmbrull pushed a commit to pmbrull/OpenMetadata that referenced this pull request Jul 27, 2022
pmbrull added a commit that referenced this pull request Jul 27, 2022
* Fix #5890 - Add health endpoint (#6030)

* Add health endpoint

* Replace rest_status for health

* Update message

* [ISSUE-6162] Upgrade RS SQL statement query (#6188)

* Upgrade RS SQL statement query

* Fix query, remove dupes

* [ISSUE-6162] Escape wildcards on revised RS query (#6200)

[ISSUE-6162] Escape wildcards on revised RS query (#6200)

* Remove retry in ES query (#6191)

Remove retry in ES query (#6191)

* min/max

* Fix  #6161 - kill endpoint for Airflow REST (#6244)

Fix  #6161 - kill endpoint for Airflow REST (#6244)

* Fixes #6031 & #6236 -- Handle binary field & UUID when ingesting sample data (#6233)

Fixes #6031 & #6236 -- Handle binary field & UUID when ingesting sample data (#6233)

* overwrite default sum function to add super for BQ overflow (#6252)

* [TASK-6241] Cache ES ingestion when ingesting usage (#6276)

* Cache ingestion

* Uncomment secrets manager

* Fix experiment stuff

* Fix style

* Add LRU cache

* Add tests

* Fix code smell

* [TASK-6140] Add OMeta header to SQLAlchemy-based queries (#6293)

[TASK-6140] Add OMeta header to SQLAlchemy-based queries (#6293)

* Fix #6248: Use PUT API instead of POST for tag & tagCategory (#6344)

* Fix #6248: Use PUT API instead of POST for tag & tagCategory

* Restructure yield_tag topology

* Renamed method to create_or_update

* compressed logs

* Update packages

* feat(ui): sync OMD theme with AntD components (#6148)

* feat(ui): sync omd theme with antd components

* update package.json

* fixed failing cypress

* fix layout break issue

Co-authored-by: Shailesh Parmar <[email protected]>
(cherry picked from commit 574dbce)

* Fix sql queries formatting

Co-authored-by: Francisco J. Jurado Moreno <[email protected]>
Co-authored-by: Teddy <[email protected]>
Co-authored-by: Mayur Singal <[email protected]>
Co-authored-by: Chirag Madlani <[email protected]>

This branch was previously deployed

1 inactive deployment
cypress — bd3986f7 Deployed Jul 23, 2022 by Beetelbrox
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.

2 participants