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

refactor: make DDL overridable for column ADD, ALTER, and RENAME operations #1114

Merged
merged 11 commits into from
Nov 9, 2022

Conversation

kgpayne
Copy link
Contributor

@kgpayne kgpayne commented Oct 26, 2022

@codecov
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Merging #1114 (d3c6d59) into main (786fd95) will decrease coverage by 0.00%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##             main    #1114      +/-   ##
==========================================
- Coverage   83.52%   83.52%   -0.01%     
==========================================
  Files          42       42              
  Lines        3860     3872      +12     
  Branches      657      657              
==========================================
+ Hits         3224     3234      +10     
- Misses        472      474       +2     
  Partials      164      164              
Impacted Files Coverage Δ
singer_sdk/connectors/sql.py 77.77% <75.00%> (+0.27%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kgpayne kgpayne marked this pull request as ready for review October 26, 2022 15:59
@kgpayne kgpayne self-assigned this Oct 26, 2022
@kgpayne
Copy link
Contributor Author

kgpayne commented Oct 26, 2022

Codecov is down by 0.52% ⬇️ As this is a refactor, and as I have a handful of other things for tap/target snowflake to get through to get to done, I'd prefer not to add testing on the refactored methods unless anyone feels very strongly about them 🙂

@kgpayne kgpayne changed the title feat: make column create/alter/rename ddl overridable refactor: make column create/alter/rename ddl overridable Oct 26, 2022
@aaronsteers aaronsteers changed the title refactor: make column create/alter/rename ddl overridable refactor: make column DDL overridable for column ADD, ALTER, and RENAME operations Oct 28, 2022
@aaronsteers aaronsteers changed the title refactor: make column DDL overridable for column ADD, ALTER, and RENAME operations refactor: make DDL overridable for column ADD, ALTER, and RENAME operations Oct 28, 2022
@aaronsteers
Copy link
Contributor

aaronsteers commented Oct 28, 2022

Codecov is down by 0.52% ⬇️ As this is a refactor, and as I have a handful of other things for tap/target snowflake to get through to get to done, I'd prefer not to add testing on the refactored methods unless anyone feels very strongly about them 🙂

@kgpayne - Do you mind adding a simple test for the DDL static method evaluation? Specifically, I'm thinking of a test for the static methods which are easily tested from a class reference and don't need the a full sink object to be created. If they return the DDL or string result expected when passed specific input values, I think that's probably reasonable.

cc @edgarrmondragon

@kgpayne
Copy link
Contributor Author

kgpayne commented Nov 8, 2022

@aaronsteers @edgarrmondragon

Renamed column add (previously create) and added tests ✅ Codecov still isn't happy though 🤦‍♂️

Copy link
Contributor

@aaronsteers aaronsteers left a comment

Choose a reason for hiding this comment

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

For my part, I think I'm okay with code coverage as is here - especially since we are also working on:

Thanks for adding the additional tests for the SQL generation. 🎉

Copy link
Collaborator

@edgarrmondragon edgarrmondragon left a comment

Choose a reason for hiding this comment

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

lgtm, the SQL API is coming together! @kgpayne the dependency review error is a false positive afaict, so feel free to merge 😄

@kgpayne kgpayne merged commit 078629d into main Nov 9, 2022
@kgpayne kgpayne deleted the kgpayne/issue1033 branch November 9, 2022 11:38
pnadolny13 added a commit to MeltanoLabs/target-snowflake that referenced this pull request Jun 2, 2023
* Closes #26
* Closes #18
* Closes #16

- completes the TODO related to meltano/sdk#1114
- Adds a default batch config because its required. Default to writing
locally.
- Add copy syntax if key properties dont exist. Previously the merge
logic was invalid due to syntax errors. Apparently my first test data
didnt have key properties
- `conform_record_data_types` requires a new `level` kwarg and was
failing because it was missing.
- the `column_exists` methods was being called a ton and was querying
snowflake for all columns every time which was slow so I have it caching
now
- the `schema_exists` method failed for me because `get_schema_names`
returns all lower columns. It errored because it was trying to create a
schema that already existed.
- bumped SDK to 0.27.0
- after bumping the SDK I needed to address
#16 which means
`create_sqlalchemy_engine` was effectively replaced with `create_engine`
- Also fix import failure of `lazy_chunked_generator` that was moved in
SDK

I'm able to test that this works with the sample tap-github data from
the getting started guide.

---------

Co-authored-by: Edgar R. M. <edgarrm358@gmail.com>
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.

feat: allow ALTER TABLE and ALTER COLUMN syntax to be overridden
3 participants