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

[BUG] Events import failed after updating to v2.6 #756

Open
julianogv opened this issue May 29, 2024 · 3 comments
Open

[BUG] Events import failed after updating to v2.6 #756

julianogv opened this issue May 29, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@julianogv
Copy link

What is the bug?

I have a project with a folder named events and after updating the opensearch-py from 2.5 to 2.6, where the service time metrics was added, I'm receiving the error below because python tries to import the Events from my project's home directory and not from the Events lib.
As events is a common name for folders and it might cause some trouble with other people too, do you have any suggestion for fixing this issue without renaming my project's folder to another name?

 File "/home/[redacted]/venv/lib/python3.11/site-packages/opensearchpy/metrics/metrics_events.py", line 13, in <module>
    from events import Events
ImportError: cannot import name 'Events' from 'events'

How can one reproduce the bug?

Add a folder events to your project and them call from opensearchpy import OpenSearch

What is your host/environment?

python3.11 + ubuntu 20 + opensearch 2.6

@julianogv julianogv added bug Something isn't working untriaged Need triage labels May 29, 2024
@dblock
Copy link
Member

dblock commented May 29, 2024

Should it be importing from the lib? Is this something we can/need to change in the library? If you know how, please PR?

@dblock dblock removed the untriaged Need triage label May 29, 2024
@fnitsche
Copy link

fnitsche commented Jul 9, 2024

Yep, we are hitting this issue too. We have an events folder and get the same error when we try to update to 2.6

@saimedhi
Copy link
Collaborator

saimedhi commented Jul 9, 2024

@fnitsche, @julianogv, would you be interested in contributing a fix for this issue? Thanks!

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

5 participants
@dblock @julianogv @fnitsche @saimedhi and others