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: "PostgresMetadataExtractor doesn't discover Redshift late binding views" #356
fix: "PostgresMetadataExtractor doesn't discover Redshift late binding views" #356
Conversation
1641197
to
043f190
Compare
some checks are failing |
a937506
to
ed5657b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the contribution. Doe the refactor / new feature cover by the existing unit test?
It's not, and I'm not sure what the best way to test this is. The underlying issue is that the SQL we're running to pull tables and views in Redshift misses a category of views. From looking at the unit tests currently in Amundsen, none of them actually run any SQL (they just mock the results from SQL Alchemy). I could write some tests for the new P.S. I'm also on the Amundsen Slack (Nathan Lawrence) if you'd like to chat synchronously sometime tomorrow. I work 9-5pm pacific and I'm mostly free tomorrow. |
I'll also add that I've tested this on a local installation and verified that the changes work as expected. |
yeah, I think it is fine, if it is a SQL change. I will take a look at the pr in detail. thanks for the clarification. |
the change lgtm (I don't know much about the actual SQL, but based on your local testing, I assume it should work as expected), if you could add some basic unit tests, we are good to go! |
Signed-off-by: Nathan Lawrence <nathanlawrence@asana.com>
ed5657b
to
3bc4f74
Compare
Thanks. Updated to copy over some of the Postgres tests and ensure that they work with the similar Redshift extractor. In the process, I made some updates to the Postgres tests. The scope that we were passing the extractor was wrong, and the tests were really just using the default config parameters for most tests. This only showed up when I copied the tests over because the database key check started to fail (checking against the passed redshift vs. the default postgres). |
thanks @nathanlawrence-asana |
Summary of Changes
Splits
PostgresMetadataExtractor
intoBasePostgresMetadataExtractor
,PostgresMetadataExtractor
andRedshiftMetadataExtractor
(the latter two inherit fromBasePostgresMetadataExtractor
).This allows us to safely modify the
SQL_QUERY
constant for Redshift-based deployments to pull late binding views into Amundsen.See amundsen-io/amundsen#672
Tests
I'm happy to write tests once folks are happy with the general structure of the PR (this is my first time contributing :) ).
My understanding is that I should be adding a new test for the
RedshiftMetadataExtractor
similar to what we have currently for thePostgresMetadataExtractor
.Documentation
I'm happy to update documentation once folks are happy with the general structure of the PR (this is my first time contributing :) ).
My understanding is that the main place that needs to be updated is adding a new section to
README.md
CheckList
Make sure you have checked all steps below to ensure a timely review.
make test