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-1638407 Added some simple tests for TimedeltaIndex indexing #2183

Merged

Conversation

sfc-gh-vbudati
Copy link
Contributor

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

    Fixes SNOW-1638407

  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.

Added tests for:

  • indexing on a TimedeltaIndex.
  • indexing on a Series and DataFrame with a TimedeltaIndex index.

@sfc-gh-vbudati sfc-gh-vbudati added NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs labels Aug 28, 2024
@sfc-gh-vbudati sfc-gh-vbudati requested a review from a team as a code owner August 28, 2024 21:40
Copy link
Collaborator

@sfc-gh-azhan sfc-gh-azhan left a comment

Choose a reason for hiding this comment

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

can we also test a set case esp. an enlargement case.
for example, a df has timedelta index and now we do df.loc[pd.Timedelta('2 hours'),:] = x

)


def test_df_with_timedelta_index_enlargement_during_indexing():
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be possible for this test to be parametrized, rather than a sequence of SqlCounter blocks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would become more dense since some of the tests are run on snow_df["a"]. If you still prefer that I parameterize the test I can try to do that

Copy link
Contributor

@sfc-gh-helmeleegy sfc-gh-helmeleegy 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, thanks Varnika!

@sfc-gh-vbudati sfc-gh-vbudati merged commit 200c485 into main Aug 30, 2024
33 of 34 checks passed
@sfc-gh-vbudati sfc-gh-vbudati deleted the vbudati/SNOW-1638407-test-timedelta-index-in-indexing branch August 30, 2024 17:21
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 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 NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs snowpark-pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants