-
Notifications
You must be signed in to change notification settings - Fork 4
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
2695 field spaces #2704
2695 field spaces #2704
Conversation
- Added new tests - Updated make validator to handle type errors
- Add datafile
Adding patch that implements disabling validators. |
…2695-field-spaces
…ed to be - removed unnecessary validator - updated schemas -
- Updated incorrect fields and catch validator error
- Updating tests
…2695-field-spaces
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2704 +/- ##
===========================================
- Coverage 92.99% 92.43% -0.56%
===========================================
Files 219 239 +20
Lines 4482 5354 +872
Branches 385 473 +88
===========================================
+ Hits 4168 4949 +781
- Misses 242 312 +70
- Partials 72 93 +21
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
…2695-field-spaces
- Updated logic on when to run field validators - Updated schemas
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.
lgtm though I am mostly just trying to familiarize myself.
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.
minor conversation topic, maybe some unused code. overall looks good, thank you!
@@ -114,7 +114,9 @@ def run_field_validators(self, instance, generate_error): | |||
else: | |||
value = getattr(instance, field.name, None) | |||
|
|||
if field.required and not value_is_empty(value, field.endIndex-field.startIndex): | |||
is_empty = value_is_empty(value, field.endIndex-field.startIndex) |
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.
value_is_empty
doesn't test for 0
-filled strings, which i think is fine but worth calling out since we have other 'space'-fill operators (@
and #
). the end result currently is
'000' -> 0
' ' -> None
'###' -> None
'@@@' -> None
maybe a possibility is to add 0
-fills to value_is_empty
so that 0
becomes None
for non-required fields, but i think this could cause side effects with actual 0
values we want to preserve. moreover, i think you're currently meeting the requirements as i understand them - treat 0
as 0
but allow for space-filling as well - space filling just results in a slightly different result.
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.
Ya I didn't think we wanted to add zero fill to the value_is_empty
function since there are so many fields across the schemas that expect zero as a valid value. I will point Alex at this as well to make sure everything is good.
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.
@ADPennington can you verify that this is the logic we want in these situations?
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.
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.
LGTM
…2695-field-spaces
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.
Summary of Changes
Pull request closes As tech lead, I need some space-filled values to be allowed in TANF Section 1 data files #2695
How to Test
tanf_section1_blanks.txt
and verify all records parse and there are no ParserErrorsDeliverables
More details on how deliverables herein are assessed included here.
Deliverable 1: Accepted Features
Checklist of ACs:
T1
data elements with spaces as values are not flagged as cat 2 (out-of-range) errorsT2
data elements with spaces as values are not flagged as cat 2 (out-of-range) errorsT3
data elements with spaces as values are not flagged as cat 2 (out-of-range) errorslfrohlich
and/oradpennington
confirmed that ACs are met.Deliverable 2: Tested Code
CodeCov Report
comment in PR)CodeCov Report
comment in PR)Deliverable 3: Properly Styled Code
Deliverable 4: Accessible
iamjolly
andttran-hub
using Accessibility Insights reveal any errors introduced in this PR?Deliverable 5: Deployed
Deliverable 6: Documented
Deliverable 7: Secure
Deliverable 8: User Research
Research product(s) clearly articulate(s):