Avoid multiple assignments of constant ALLOWED_INPUT_SCHEMAS#280
Avoid multiple assignments of constant ALLOWED_INPUT_SCHEMAS#280yarikoptic merged 1 commit intodandi:masterfrom
ALLOWED_INPUT_SCHEMAS#280Conversation
This also improves readability
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #280 +/- ##
==========================================
- Coverage 97.54% 92.29% -5.26%
==========================================
Files 16 16
Lines 1753 1751 -2
==========================================
- Hits 1710 1616 -94
- Misses 43 135 +92
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| ALLOWED_VALIDATION_SCHEMAS = sorted( | ||
| set(ALLOWED_INPUT_SCHEMAS).union(ALLOWED_TARGET_SCHEMAS) | ||
| ) |
There was a problem hiding this comment.
If set(ALLOWED_TARGET_SCHEMAS) is always a subset of set(ALLOWED_INPUT_SCHEMAS), as it currently is, we can further simplify the definition of ALLOWED_VALIDATION_SCHEMAS to the following.
| ALLOWED_VALIDATION_SCHEMAS = sorted( | |
| set(ALLOWED_INPUT_SCHEMAS).union(ALLOWED_TARGET_SCHEMAS) | |
| ) | |
| ALLOWED_VALIDATION_SCHEMAS = ALLOWED_INPUT_SCHEMAS |
There was a problem hiding this comment.
feels like indeed we could have simplified like this, but for now let's just keep as is, may be there would be some time some divergence ;-)
This PR avoids multiple assignment of the constant
ALLOWED_INPUT_SCHEMAS. Incidentally, it improves readability, and ensuresALLOWED_VALIDATION_SCHEMASis always sorted.Please, also checkout an alternative to this PR posted below.