-
Notifications
You must be signed in to change notification settings - Fork 27
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
♻️ [#5044] Add constant for dataSrc options #5080
Conversation
58b3212
to
ede4fe9
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5080 +/- ##
=======================================
Coverage 96.72% 96.72%
=======================================
Files 770 770
Lines 26524 26534 +10
Branches 3452 3452
=======================================
+ Hits 25656 25666 +10
Misses 606 606
Partials 262 262 ☔ View full report in Codecov by Sentry. |
src/openforms/formio/typing/base.py
Outdated
dataSrc: NotRequired[ | ||
Literal[ | ||
DataSrcOptions.manual, | ||
DataSrcOptions.variable, | ||
DataSrcOptions.referentielijsten, | ||
] | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fairly certain type checkers don't understand this - type checking is done statically and no python code is actually evaluated.
dataSrc: NotRequired[ | |
Literal[ | |
DataSrcOptions.manual, | |
DataSrcOptions.variable, | |
DataSrcOptions.referentielijsten, | |
] | |
] | |
dataSrc: NotRequired[DataSrcOptions] |
using the choices class should help enforce that comparisons are made with the constant rather than magic strings, but I haven't tested this.
ede4fe9
to
5fccbdf
Compare
Closes #5044
Changes
Checklist
Check off the items that are completed or not relevant.
Impact on features
Release management
I have updated the translations assets (you do NOT need to provide translations)
./bin/makemessages_js.sh
./bin/compilemessages_js.sh
Dockerfile/scripts
./bin
folderCommit hygiene