Skip to content

Fix "opentelemetry.instrumentation.sqlalchemy" has no attribute "SQLAlchemyInstrumentor" [attr-defined] #95

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

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

sorasful
Copy link
Contributor

@sorasful sorasful commented Jul 4, 2022

Hi there !

I've been trying the template with SQLAlchemy but the pre-commit wouldn't work because the line was too long and the # type: ignore would not go on the right line :

(centaure-7kcMhmah-py3.10)  xxx@xxx  ~/dev/centaure   master ✚  git commit -m "Initial commit"
Check python ast.........................................................Passed
Trim Trailing Whitespace.................................................Passed
Check Toml...............................................................Passed
Fix End of Files.........................................................Passed
Add trailing commas......................................................Failed
- hook id: add-trailing-comma
- exit code: 1
- files were modified by this hook

Rewriting centaure/web/lifetime.py

Pretty format YAML.......................................................Passed
Format with Black........................................................Passed
autoflake................................................................Passed
isort....................................................................Passed
Check with Flake8........................................................Passed
Validate types with MyPy.................................................Failed
- hook id: mypy
- exit code: 1

centaure/web/lifetime.py:10: error: Module
"opentelemetry.instrumentation.sqlalchemy" has no attribute
"SQLAlchemyInstrumentor"  [attr-defined]
    from opentelemetry.instrumentation.sqlalchemy import (
    ^
Found 1 error in 1 file (checked 51 source files)



So, here's a quick fix.

…lchemyInstrumentor" [attr-defined]

Hi there ! 

I've been trying the template with SQLAlchemy but the pre-commit wouldn't work because  the line was too long and the `# type: ignore` would not go on the right line : 

```
(centaure-7kcMhmah-py3.10)  xxx@xxx  ~/dev/centaure   master ✚  git commit -m "Initial commit"
Check python ast.........................................................Passed
Trim Trailing Whitespace.................................................Passed
Check Toml...............................................................Passed
Fix End of Files.........................................................Passed
Add trailing commas......................................................Failed
- hook id: add-trailing-comma
- exit code: 1
- files were modified by this hook

Rewriting centaure/web/lifetime.py

Pretty format YAML.......................................................Passed
Format with Black........................................................Passed
autoflake................................................................Passed
isort....................................................................Passed
Check with Flake8........................................................Passed
Validate types with MyPy.................................................Failed
- hook id: mypy
- exit code: 1

centaure/web/lifetime.py:10: error: Module
"opentelemetry.instrumentation.sqlalchemy" has no attribute
"SQLAlchemyInstrumentor"  [attr-defined]
    from opentelemetry.instrumentation.sqlalchemy import (
    ^
Found 1 error in 1 file (checked 51 source files)



```

So, here's a quick fix.
@s3rius
Copy link
Owner

s3rius commented Jul 4, 2022

Wow, thanks!

@s3rius s3rius changed the base branch from master to release/3.3.6 July 4, 2022 20:11
@sorasful
Copy link
Contributor Author

sorasful commented Jul 4, 2022

That's not much haha, but you're welcome !

@s3rius s3rius merged commit 3f51f34 into s3rius:release/3.3.6 Jul 5, 2022
@s3rius
Copy link
Owner

s3rius commented Jul 5, 2022

Will be released in 3.3.6.

@s3rius
Copy link
Owner

s3rius commented Jul 6, 2022

Hi there. I added request that eliminates missing imports problem for opentelemetry package. Please check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants