Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add ok/error logic to the decorator #79

Merged
merged 19 commits into from
Aug 28, 2023
Merged

Conversation

flenter
Copy link
Member

@flenter flenter commented Aug 21, 2023

And also switch to mypy (instead of pyright). There's an issue with pyright and the return value for coroutines (microsoft/pyright#5745) which caused problems for our library and I also ran into issues when overloading the decorator and pyright not complaining about certain overloads which would never be used because other overloads were more generic/broadly defined).

Anyway the real meat of the matter is the addition of:
record_error_if
record_ok_if

Which allows the user of the lib to make certain exceptions not show up as errors and certain normal responses to register as errors.

Resolves #45

@flenter flenter force-pushed the resolve_45_add_ok_error_logic branch from 932442a to b5b82f8 Compare August 21, 2023 21:11
This is done by using the "follow_imports=skip" option for opentelemetry.attributes
Copy link
Contributor

@actualwitch actualwitch left a comment

Choose a reason for hiding this comment

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

looking good!

@@ -24,10 +24,12 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install dependencies
run: poetry install --no-interaction --no-root --with dev
run: poetry install --no-interaction --no-root --with dev --with examples
Copy link
Contributor

Choose a reason for hiding this comment

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

--with supports comma separated syntax too 🙃

Suggested change
run: poetry install --no-interaction --no-root --with dev --with examples
run: poetry install --no-interaction --no-root --with dev,examples

src/py.typed Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

nice! i wanted to add these as well

pyproject.toml Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

since we are exposing types correctly now, i think it would be fair to also add the "Typing :: Typed" classifier 🧐

@flenter flenter merged commit 87eb542 into main Aug 28, 2023
@flenter flenter deleted the resolve_45_add_ok_error_logic branch August 28, 2023 13:45
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to define 'ok' versus 'error' results
2 participants