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

Make optional types explicit #255

Merged
merged 16 commits into from
Feb 7, 2022
Merged

Make optional types explicit #255

merged 16 commits into from
Feb 7, 2022

Conversation

dbrattli
Copy link
Contributor

@dbrattli dbrattli commented Jan 8, 2022

Description

Make optional types explicit. A past version of PEP-484 allowed type checkers to assume an optional type when the default value is None, as in this code:

def handle_employee(e: Employee = None): ...

This would have been treated as equivalent to:

def handle_employee(e: Optional[Employee] = None) -> None: ...

This is no longer the recommended behavior. Type checkers should move towards requiring the optional type to be made explicit. For more info see: https://www.python.org/dev/peps/pep-0484/#id29

@rhuanbarreto
Copy link

@patkivikram can someone approve to run workflows in this PR?

@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2022

Codecov Report

Merging #255 (9185026) into master (35d6885) will decrease coverage by 0.01%.
The diff coverage is 97.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #255      +/-   ##
==========================================
- Coverage   94.25%   94.23%   -0.02%     
==========================================
  Files         100      100              
  Lines       10826    10829       +3     
  Branches     1479     1479              
==========================================
+ Hits        10204    10205       +1     
- Misses        551      553       +2     
  Partials       71       71              
Impacted Files Coverage Δ
faust/agents/agent.py 98.06% <ø> (ø)
faust/app/base.py 99.51% <ø> (ø)
faust/auth.py 100.00% <ø> (ø)
faust/contrib/sentry.py 0.00% <ø> (ø)
faust/events.py 100.00% <ø> (ø)
faust/livecheck/app.py 100.00% <ø> (ø)
faust/models/base.py 100.00% <ø> (ø)
faust/models/record.py 96.38% <ø> (ø)
faust/sensors/datadog.py 98.71% <ø> (ø)
faust/sensors/monitor.py 99.64% <ø> (ø)
... and 36 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc3cc15...9185026. Read the comment docs.

@patkivikram patkivikram merged commit 96ce8f0 into faust-streaming:master Feb 7, 2022
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.

4 participants