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

[py-tx] Typing of SignalExchangeAPIWithSimpleUpdates is too Generic | remove use of t.Any #1255

Open
BarrettOlson opened this issue Jan 19, 2023 · 0 comments
Assignees
Labels
python-threatexchange Items related to the threatexchange python tool / library

Comments

@BarrettOlson
Copy link
Contributor

See #1254

In order pass mypy the last arg in the type of
SignalExchangeAPIWithSimpleUpdates was made generic.

Previous value: state.TFetchedSignalMetadata which gave error
threatexchange/exchanges/signal_exchange_api.py:269: error: Variance of TypeVar "state.TFetchedSignalMetadata" incompatible with variance in parent type [type-var]

Having this be generic is risky because SignalExchangeAPIWithSimpleUpdates is one of the single most important interface in pytx


Notes from brief attempt to fix: When Barrett attempted to replace value with state.TUpdateRecordValue mypy broke further along in files using SignalExchangeAPIWithSimpleUpdates so there may more bugs hidden behind this issue already.

@Dcallies Dcallies added the python-threatexchange Items related to the threatexchange python tool / library label Mar 14, 2023
@Dcallies Dcallies changed the title Typing of SignalExchangeAPIWithSimpleUpdates is too Generic | remove use of t.Any [py-tx] Typing of SignalExchangeAPIWithSimpleUpdates is too Generic | remove use of t.Any Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python-threatexchange Items related to the threatexchange python tool / library
Projects
None yet
Development

No branches or pull requests

2 participants