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-849605: fix datatype misalignment #1001

Conversation

sfc-gh-aling
Copy link
Contributor

Please answer these questions before submitting your pull requests. Thanks!

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

    Fixes #SNOW-849605

  • fix nullable
  • fix time type, timestamp type
  1. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
  2. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.

@sfc-gh-aling sfc-gh-aling requested a review from a team as a code owner August 10, 2023 17:31
@sfc-gh-aling sfc-gh-aling requested review from sfc-gh-yixie, sfc-gh-evandenberg, sfc-gh-stan and a team and removed request for a team August 10, 2023 17:31
@sfc-gh-stan
Copy link
Collaborator

Is this all the misalignment we currently know of?

src/snowflake/snowpark/mock/analyzer.py Show resolved Hide resolved
if isinstance(result[c].sf_type.datatype, NullType):
ret.append(
Attribute(
result[c].name if result[c].name else "NULL", StringType(), True
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious: Do we support multiple columns of the same name NULL from describe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, you will get two columns of name NULL by the following scripts:

    df2 = session.create_dataframe([1, 2]).to_df("a").select(lit(None), lit(None))
    assert len(df2.schema.fields) == 2
    assert df2.schema.fields[0].datatype == StringType()

@sfc-gh-aling sfc-gh-aling force-pushed the SNOW-849605-p-0-column-type-alignment-with-live-snowflake-db branch from eba3789 to 79258cc Compare August 11, 2023 21:45
@sfc-gh-aling sfc-gh-aling merged commit d56cfa5 into dev/local-testing Aug 11, 2023
7 of 38 checks passed
@sfc-gh-aling sfc-gh-aling deleted the SNOW-849605-p-0-column-type-alignment-with-live-snowflake-db branch August 11, 2023 22:08
@github-actions github-actions bot locked and limited conversation to collaborators Aug 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants