Skip to content

BUG: After upgrading the version, unlike the api of v1.2.3, closed was replaced by inclusive, which led to different results #46526

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
1 of 3 tasks
allendred opened this issue Mar 27, 2022 · 6 comments
Labels
Bug Needs Info Clarification about behavior needed to assess issue Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@allendred
Copy link

allendred commented Mar 27, 2022

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

>>> import pandas as pd
>>> pd.DataFrame(pd.date_range(start=f'{str("2022-03-01")}', end=f'{str(2022)}-{str("03")}-01', freq='30min', inclusive='left'))
           0
0 2022-03-01

Issue Description

Version 1.2.3 is OK with Argument closed
Argument closed is deprecated in Version 1.4.1

Expected Behavior

Empty DataFrame
Columns: [0]
Index: []

Installed Versions

V1.4.1

@allendred allendred added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 27, 2022
@MarcoGorelli
Copy link
Member

I just tried your example and it works fine:

>>> import pandas as pd
>>> pd.DataFrame(pd.date_range(start=f'{str("2022-03-01")}', end=f'{str(2022)}-{str("03")}-01', freq='30min', inclusive='left'))
           0
0 2022-03-01
>>> pd.__version__
'1.4.1'

could you clarify what you think the bug is, and put a descriptive title?

@MarcoGorelli MarcoGorelli added the Needs Info Clarification about behavior needed to assess issue label Mar 27, 2022
@attack68
Copy link
Contributor

This has no descriptive title, nor is the issue clearly stated, and the example seems to work fine.

Closing for now. Please re-open when more info and description is available, thank you.

@allendred allendred changed the title BUG: BUG: After upgrading the version, unlike the api of v1.2.3, closed was replaced by inclusive, which led to different results Mar 29, 2022
@allendred
Copy link
Author

I just tried your example and it works fine:

>>> import pandas as pd
>>> pd.DataFrame(pd.date_range(start=f'{str("2022-03-01")}', end=f'{str(2022)}-{str("03")}-01', freq='30min', inclusive='left'))
           0
0 2022-03-01
>>> pd.__version__
'1.4.1'

could you clarify what you think the bug is, and put a descriptive title?
The expected output

pd.DataFrame(pd.date_range(start=f'{str("2022-03-01")}', end=f'{str(2022)}-{str("03")}-01', freq='30min', inclusive='left'))
Empty DataFrame
Columns: [0]
Index: []

This is different from the previous comparison, it may be a logical problem

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Mar 29, 2022

what's different?

>>> pd.DataFrame(pd.date_range(start=f'{str("2022-03-01")}', end=f'{str(2022)}-{str("03")}-01', freq='30min', inclusive='left'))
           0
0 2022-03-01
>>> pd.DataFrame(pd.date_range(start=f'{str("2022-03-01")}', end=f'{str(2022)}-{str("03")}-01', freq='30min', closed='left'))
<stdin>:1: FutureWarning: Argument `closed` is deprecated in favor of `inclusive`.
           0
0 2022-03-01
>>> pd.__version__
'1.4.1'

@MarcoGorelli
Copy link
Member

ah, I see what you mean, in 1.2.3 the output was different:

>>> pd.DataFrame(pd.date_range(start=f'{str("2022-03-01")}', end=f'{str(2022)}-{str("03")}-01', freq='30min', closed='left'))
Empty DataFrame
Columns: [0]
Index: []
>>> pd.__version__
'1.2.3'

@MarcoGorelli
Copy link
Member

looks like this was changed intentionally in #43394 , so no action needed here

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug Needs Info Clarification about behavior needed to assess issue Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

3 participants