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

support typeguard < 3 for better compatability #1563

Merged
merged 4 commits into from
Apr 12, 2024

Conversation

cosmicBboy
Copy link
Collaborator

This PR loosens the typeguard version dependency to support version < 3. Addresses the comment here: #1365 (comment)

Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
@z4m0
Copy link

z4m0 commented Apr 11, 2024

Hi @cosmicBboy, thank you for your extremely fast response and solution! :)

For us it would work without problems as we don't use these generic types.

However if I understand correctly there is a tradeoff because this may introduce silent bugs in somebody else's code. Imagine something like this:

  1. Having some working Pandera pandera code with generic types
  2. Install jaxtyping => typeguard downgrades to v2 and tools like pip-compile wouldn't raise errors.
  3. Pandera now works different and if the code is not very well tested this may go unnoticed.

Another thing in the case you decide to proceed the requirements.in file, shouldn't be changed as well? setting typeguard >= 2.13.3

@cosmicBboy
Copy link
Collaborator Author

Pandera now works different and if the code is not very well tested this may go unnoticed.

Will add a warning so that the behavior is more transparent

Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
@yuenherny
Copy link

Hi @cosmicBboy , thank you for the prompt solution. With this change, would Series[TYPE] gets affected as well or it is just LIST[TYPE] and DICT[TYPE, TYPE]?

E.g.

from pandera.typing import DataFrame, Series

class DataFrameSchema(pa.DataFrameModel):
    Index: Series[pa.Int]
    TimeStamp: Series[pa.Timestamp]
    Value: Series[pa.Float]


TimeSeries = DataFrame[DataFrameSchema]

@cosmicBboy
Copy link
Collaborator Author

cosmicBboy commented Apr 12, 2024

Hi @cosmicBboy , thank you for the prompt solution. With this change, would Series[TYPE] gets affected as well or it is just LIST[TYPE] and DICT[TYPE, TYPE]?

Just the typing module types

@cosmicBboy cosmicBboy merged commit 8333d80 into main Apr 12, 2024
72 checks passed
@cosmicBboy cosmicBboy deleted the loosen-typeguard-version branch April 13, 2024 04:23
alanhdu added a commit to alanhdu/pandera-feedstock that referenced this pull request Aug 13, 2024
Follow in the foodsteps of unionai-oss/pandera#1563 and relax the typeguard restriction. This allows the use of Pandera w/ typeguard 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants