Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Resolved issue #225#293

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
TMVKasiViswanath wants to merge2 commits into4n4nd:master
base:master
Choose a base branch
Loading
fromTMVKasiViswanath:fixing_imports

Conversation

@TMVKasiViswanath
Copy link

Optimized imports in theinit method by implementing lazy imports. This prevents unnecessary imports of unused classes, ensuring that only the required classes are imported when needed. This reduces memory usage and improves efficiency. I have tested this to confirm that the changes work as expected.

RemiDesgrange reacted with hooray emoji
@4n4nd
Copy link
Owner

@TMVKasiViswanath all tests seem to be failing. Could you give it a look?

Copy link
Collaborator

@harshad16harshad16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

great initiative
getattr in init.py might increase the maintainability of the module , right ?

I'm also not able to follow, how this fixes the#225 request.
as the request there is to, split the module with main dependency and optional dependency.
The current installation ofprometheus_api_client bring in pandas and additional package that is only required for Metrics class usage but not for PrometheusConnect operation.
For fixing the issue, we would need to change the packaging of the module.

__title__="prometheus-connect"
__version__="0.5.7"

from .prometheus_connectimport*# noqa F403
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The additional classes also need to be adjusted, if we are explicitly defining each class available with prometheus_api_client.

from prometheus_api_client import PrometheusApiClientException

this would fails with current implementation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

yes, I forgot to add 2 more imports in the init file

@TMVKasiViswanath
Copy link
Author

@TMVKasiViswanath all tests seem to be failing. Could you give it a look?

Yes I have made the changes and made the new commit to it

@TMVKasiViswanathTMVKasiViswanath marked this pull request as draftFebruary 21, 2025 20:40
@TMVKasiViswanathTMVKasiViswanath marked this pull request as ready for reviewFebruary 21, 2025 20:40
@TMVKasiViswanath
Copy link
Author

TMVKasiViswanath commentedFeb 22, 2025
edited
Loading

@4n4nd The test failures are not caused by my changes. The errors indicate that demo.robustperception.io:9090 is unreachable ([Errno 101] Network is unreachable).

To verify, I set up a local Prometheus instance, pointed PrometheusConnect to it, and ran the tests. Everything passed successfully.(All the 44 test cases in the tests folder got executed)

This suggests that the issue is with the availability of the demo server, not my modifications toinit.py. Once the server is back up, rerunning the workflow should make the tests pass without any issues.
Test Passed on Local Prometheus

@4n4nd
Copy link
Owner

@TMVKasiViswanath that should be fixed now. Could you please rebase and try again?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@harshad16harshad16harshad16 left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@TMVKasiViswanath@4n4nd@harshad16

[8]ページ先頭

©2009-2025 Movatter.jp