typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Improve PyMySQL stubs

Open ashm-dev opened this issue 1 year ago • 11 comments

ashm-dev avatar Aug 25 '24 14:08 ashm-dev

Diff from mypy_primer, showing the effect of this PR on open source code:

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/mysql/datatypes.py:27: error: Module "pymysql.connections" has no attribute "TEXT_TYPES"  [attr-defined]

github-actions[bot] avatar Aug 25 '24 14:08 github-actions[bot]

In the code, this TEXT_TYPES value is https://github.com/PyMySQL/PyMySQL/blob/95635f587ba9076e71a223b113efb08ac34a361d/pymysql/connections.py#L49

ashm-dev avatar Aug 25 '24 14:08 ashm-dev

Diff from mypy_primer, showing the effect of this PR on open source code:

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/mysql/datatypes.py:27: error: Module "pymysql.connections" has no attribute "TEXT_TYPES"  [attr-defined]

github-actions[bot] avatar Aug 25 '24 15:08 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/mysql/datatypes.py:27: error: Module "pymysql.connections" has no attribute "TEXT_TYPES"  [attr-defined]

github-actions[bot] avatar Aug 26 '24 18:08 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/mysql/datatypes.py:27: error: Module "pymysql.connections" has no attribute "TEXT_TYPES"  [attr-defined]

github-actions[bot] avatar Aug 27 '24 09:08 github-actions[bot]

@AlexWaygood @srittau can you please review my PR if it's not difficult!)

ashm-dev avatar Aug 28 '24 09:08 ashm-dev

Thanks. I've noticed that you included a few private functions and methods in the stubs. Do you need them? We usually only include private items when they are explicitly requested.

No, I don't need them, I just want to start actively contributing to this project, because I'm interested in typing.

ashm-dev avatar Aug 29 '24 14:08 ashm-dev

Diff from mypy_primer, showing the effect of this PR on open source code:

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/mysql/datatypes.py:27: error: Module "pymysql.connections" has no attribute "TEXT_TYPES"  [attr-defined]

github-actions[bot] avatar Aug 29 '24 14:08 github-actions[bot]

No, I don't need them, I just want to start actively contributing to this project, because I'm interested in typing.

Ok, could you remove them for now? This makes the stubs more succinct, easier to maintain and doesn't rely on undocumented internals.

srittau avatar Aug 29 '24 14:08 srittau

No, I don't need them, I just want to start actively contributing to this project, because I'm interested in typing.

Ok, could you remove them for now? This makes the stubs more succinct, easier to maintain and doesn't rely on undocumented internals.

Alright, I'll get right on it! Thank you for your assistance!

ashm-dev avatar Aug 29 '24 15:08 ashm-dev

Diff from mypy_primer, showing the effect of this PR on open source code:

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/mysql/datatypes.py:27: error: Module "pymysql.connections" has no attribute "TEXT_TYPES"  [attr-defined]

github-actions[bot] avatar Aug 29 '24 15:08 github-actions[bot]