tlocke / pg8000

A Pure-Python PostgreSQL Driver
BSD 3-Clause "New" or "Revised" License
515 stars 46 forks source link

add `Connection` to `pg8000.native.__all__` #158

Closed trim21 closed 1 month ago

trim21 commented 2 months ago

Connection is missing in pg8000.native.__all__ cause a warning on from pg8000.native import Connection

tlocke commented 2 months ago

Hi @trim21, thanks for your bug report. I agree that Connection should be in __all__. I tried to reproduce the warning though, but found I couldn't. So I created a file called test.py:

from pg8000.native import Connection

and ran:

python -Werror test.py

but this didn't give a warning. How did you get it to give a warning?

trim21 commented 2 months ago

Hi @trim21, thanks for your bug report. I agree that Connection should be in __all__. I tried to reproduce the warning though, but found I couldn't. So I created a file called test.py:

from pg8000.native import Connection

and ran:

python -Werror test.py

but this didn't give a warning. How did you get it to give a warning?

linter

tlocke commented 2 months ago

That makes sense. Which linter is it? I run things through Flake8 and it didn't pick this up.

trim21 commented 2 months ago

That makes sense. Which linter is it? I run things through Flake8 and it didn't pick this up.

it's pycharm built-in linter rules.

image

tlocke commented 1 month ago

Thanks for your work on this @trim21, I've added some tests and used your patch at https://github.com/tlocke/pg8000/commit/b30177e478c446f3e26eef94a49c912e28ffe2b6