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

SNOW-1617349: Add aliases for format options to dataframe reader and writer #2155

Conversation

sfc-gh-aalam
Copy link
Contributor

@sfc-gh-aalam sfc-gh-aalam commented Aug 22, 2024

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1617349

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
  3. Please describe how your code solves the related issue.

    This PR adds reader and writer option aliases to help with migration. One pager about this change is here: https://docs.google.com/document/d/1U-VucApRuC74RsPEvZ5HUzqZf1NluintZ8z1Nl7fI2w/edit

@sfc-gh-aalam sfc-gh-aalam marked this pull request as ready for review August 27, 2024 19:47
@sfc-gh-aalam sfc-gh-aalam requested a review from a team as a code owner August 27, 2024 19:47
Copy link
Contributor

@sfc-gh-jrose sfc-gh-jrose left a comment

Choose a reason for hiding this comment

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

The functionallity between read and write looks the same, but done in a two similar, but different ways. It might be worthwhile to extract this to a utils function to keep things dry and to make sure the error message remains consistent between the two in the future.

@sfc-gh-aalam
Copy link
Contributor Author

The functionallity between read and write looks the same, but done in a two similar, but different ways. It might be worthwhile to extract this to a utils function to keep things dry and to make sure the error message remains consistent between the two in the future.

Yeah. They are very similar. I added a util function to deduplicate the work

Copy link
Collaborator

@sfc-gh-evandenberg sfc-gh-evandenberg left a comment

Choose a reason for hiding this comment

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

Looks good with one minor comment.

def get_aliased_option_name(
key: str,
alias_map: Dict[str, str],
) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure. added

@sfc-gh-aalam sfc-gh-aalam added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label Aug 28, 2024
@sfc-gh-aalam sfc-gh-aalam merged commit d66f57b into main Aug 28, 2024
32 of 33 checks passed
@sfc-gh-aalam sfc-gh-aalam deleted the aalam-SNOW-1617349-align-with-copy-into-for-option-discrepency-with-pyspark branch August 28, 2024 23:53
@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants