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-1625379 Test coverage for timedelta under modin/integ/frame part 1 #2171

Merged
merged 6 commits into from
Aug 28, 2024

Conversation

sfc-gh-azhan
Copy link
Collaborator

@sfc-gh-azhan sfc-gh-azhan commented Aug 27, 2024

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

    Fixes SNOW-1625379 Test coverage for timedelta under modin/integ/frame part 1

  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.

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

This pull request includes several changes to enhance support for the Timedelta type, improve type handling, and add new test cases. The most important changes include adding support for various Timedelta operations, enhancing type checking and handling, and introducing new test cases to ensure the robustness of these features.

Enhancements to Timedelta Support:

  • Added support for Timedelta type in various operations like fillna, diff, duplicated, empty, insert, isin, isna, items, iterrows, join, len, melt, nlargest, and nsmallest in the CHANGELOG.md file.
  • Removed NotImplementedError for Timedelta in methods such as insert, melt, and merge in snowflake_query_compiler.py. [1] [2] [3]

Improvements in Type Handling:

  • Introduced type_match method in SnowparkPandasType class to check type compatibility.
  • Enhanced the _simple_unpivot function to handle SnowparkPandasType correctly and added type information for unpivoted columns. [1] [2] [3] [4] [5]
  • Updated fillna and diff methods to maintain SnowparkPandasType consistency after operations. [1] [2]

New Test Cases:

  • Added test cases for Timedelta type in assign, ffill, bfill, and diff methods to ensure proper functionality. [1] [2] [3] [4]
  • Introduced a new test case for Timedelta type in test_compare.py to validate comparison operations. [1] [2]

These changes collectively improve the handling and support of the Timedelta type, ensuring more robust and comprehensive functionality across various operations.

@sfc-gh-azhan sfc-gh-azhan added the NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs label Aug 27, 2024
@sfc-gh-azhan sfc-gh-azhan force-pushed the azhan-td-frame-test-1625379 branch 2 times, most recently from 7e7372d to 6fe524b Compare August 27, 2024 17:27
@@ -111,7 +118,7 @@ class SnowparkPandasColumn(NamedTuple):
snowpark_pandas_type: Optional[SnowparkPandasType]


class TimedeltaType(SnowparkPandasType, LongType):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

SnowparkPandasType already extends DataType

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

@sfc-gh-nkrishna sfc-gh-nkrishna left a comment

Choose a reason for hiding this comment

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

Two nits, but approving

tests/integ/modin/frame/test_equals.py Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@sfc-gh-mvashishtha sfc-gh-mvashishtha left a comment

Choose a reason for hiding this comment

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

some nits on the tests

tests/integ/modin/frame/test_merge.py Outdated Show resolved Hide resolved
tests/integ/modin/frame/test_melt.py Outdated Show resolved Hide resolved
tests/integ/modin/frame/test_isin.py Outdated Show resolved Hide resolved
tests/integ/modin/frame/test_insert.py Show resolved Hide resolved
tests/integ/modin/frame/test_fillna.py Show resolved Hide resolved
@sfc-gh-azhan sfc-gh-azhan force-pushed the azhan-td-frame-test-1625379 branch from ac9af50 to 2901895 Compare August 28, 2024 16:57
Copy link
Contributor

@sfc-gh-mvashishtha sfc-gh-mvashishtha left a comment

Choose a reason for hiding this comment

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

LGTM. thanks!

@sfc-gh-azhan sfc-gh-azhan enabled auto-merge (squash) August 28, 2024 18:15
@sfc-gh-azhan sfc-gh-azhan disabled auto-merge August 28, 2024 19:17
@sfc-gh-azhan sfc-gh-azhan force-pushed the azhan-td-frame-test-1625379 branch from 2901895 to 40994a3 Compare August 28, 2024 20:15
@sfc-gh-azhan sfc-gh-azhan merged commit 639724b into main Aug 28, 2024
33 checks passed
@sfc-gh-azhan sfc-gh-azhan deleted the azhan-td-frame-test-1625379 branch August 28, 2024 21:34
@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-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.

4 participants