Skip to content

Conversation

skalwaghe-56
Copy link
Contributor

@skalwaghe-56 skalwaghe-56 commented Sep 9, 2025


Adds regression tests for pandas issue #58471. Added a total of 3 tests. All tests are parameterized across datetime units (ns/us/ms/s) to verify consistent behavior.

Thanks!

@skalwaghe-56
Copy link
Contributor Author

@jbrockmendel I kindly request you to check the PR and let me know!

@jbrockmendel
Copy link
Member

Is this AI?

@skalwaghe-56
Copy link
Contributor Author

Is this AI?

The description of the PR contains some things from AI. I'm sorry if its an problem.

@skalwaghe-56
Copy link
Contributor Author

Removed the AI part! Sorry for that.

@skalwaghe-56
Copy link
Contributor Author

@jbrockmendel Please check it now. Thanks!

@simonjayhawkins simonjayhawkins added the Testing pandas testing functions or related to the test suite label Sep 10, 2025
@skalwaghe-56 skalwaghe-56 force-pushed the fix-issue-58471 branch 2 times, most recently from d9f5c25 to 2cd8c3a Compare September 11, 2025 14:30
@skalwaghe-56
Copy link
Contributor Author

@rhshadrach Request you to kindly check this.

@jbrockmendel
Copy link
Member

@skalwaghe-56 you don't need to ping us on every PR. We'll get to them all in due time.

@skalwaghe-56
Copy link
Contributor Author

@jbrockmendel Sorry Sir!

@skalwaghe-56 skalwaghe-56 force-pushed the fix-issue-58471 branch 5 times, most recently from ffe118d to 5650319 Compare September 17, 2025 16:56
Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

Thanks @skalwaghe-56 for the PR.

Let's not add all these tests, just the minimum reproducible example, which in the linked issue looks like took a few contributors until it converged on anything that look like one!

@skalwaghe-56
Copy link
Contributor Author

@simonjayhawkins Thanks for your review! I've confirmed that we include just the minimum reproducible example. I've added 2 test which I think are necessary for this issue and to confirm that is fixed properly. Thanks!

Comment on lines +298 to +299
df1 = concat([s1, s2], axis=1).sort_index()
df2 = concat([s2, s1], axis=1).sort_index()
Copy link
Member

Choose a reason for hiding this comment

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

Can you test without sort_index. Tests should generally be about a single method. If we want to test sort_index, then it should be in it's own test, but I don't think that's necessary for this bug.


@pytest.mark.parametrize("unit", ["ns"])
def test_concat_series_columns_nonoverlap_5min_units(self, unit):
# GH#58471 minimal reproducible example
Copy link
Member

Choose a reason for hiding this comment

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

nit: minimal reproducible example doesn't really add any information here and can be removed; it's generally applicable to all tests.

@rhshadrach rhshadrach added Needs Tests Unit test(s) needed to prevent regressions Datetime Datetime data dtype Reshaping Concat, Merge/Join, Stack/Unstack, Explode and removed Testing pandas testing functions or related to the test suite labels Sep 20, 2025
expected = date_range("2024-01-01", "2024-01-02 23:55", freq="5min", unit=unit)
tm.assert_index_equal(result, expected)

@pytest.mark.parametrize("unit", ["ns"])
Copy link
Member

Choose a reason for hiding this comment

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

if its only "ns", then no need for parametrizing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Needs Tests Unit test(s) needed to prevent regressions Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: concatenating time series with non ns unit leads to dataframe with missing data
4 participants