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

filip 0.3.0 not working with Python 3.9 #242

Closed
j-pick opened this issue Feb 8, 2024 · 1 comment
Closed

filip 0.3.0 not working with Python 3.9 #242

j-pick opened this issue Feb 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@j-pick
Copy link
Collaborator

j-pick commented Feb 8, 2024

Describe the bug
It is not possible to import the ContextBroker with the settings described below.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new venv with python 3.9 as base interpreter (more specifically, 3.9.7)
  2. Install filip 0.3.0 via pip
  3. Execute the following code:
from filip.clients.ngsi_v2 import ContextBrokerClient

def test_cb():
    cb = ContextBrokerClient()

if __name__ == '__main__':
    test_cb()

The code fails at the import statement already with the following error:

Traceback (most recent call last):
  File "main.py", line 1, in <module>
    from filip.clients.ngsi_v2 import ContextBrokerClient
  File "venv\lib\site-packages\filip\__init__.py", line 5, in <module>
    from filip.clients.ngsi_v2 import HttpClient
  File "venv\lib\site-packages\filip\clients\ngsi_v2\__init__.py", line 4, in <module>
    from .cb import ContextBrokerClient
  File "venv\lib\site-packages\filip\clients\ngsi_v2\cb.py", line 35, in <module>
    from filip.models.ngsi_v2.subscriptions import Subscription, Message
  File "venv\lib\site-packages\filip\models\ngsi_v2\subscriptions.py", line 308, in <module>
    class Subscription(BaseModel):
  File "venv\lib\site-packages\filip\models\ngsi_v2\subscriptions.py", line 362, in Subscription
    throttling: Optional[conint(strict=True, ge=0,)] = Field(
  File "venv\lib\site-packages\pydantic\types.py", line 225, in conint
    annotated_types.Interval(gt=gt, ge=ge, lt=lt, le=le),
TypeError: Interval() takes no arguments

Process finished with exit code 1

Expected behavior

I expect the import to work.

Screenshots

Environment (please complete the following information):

  • OS: Windows
  • Version 10

Additional context

With python 3.10 as base interpreter instead of 3. it runs without any problem.

@j-pick j-pick added the bug Something isn't working label Feb 8, 2024
@djs0109
Copy link
Contributor

djs0109 commented Feb 14, 2024

@j-pick it is a known problem, the official conclusion is not to use python 3.9.7. For further information see here pydantic/pydantic#7544

@djs0109 djs0109 closed this as completed Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants