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

remove white space from value before parsing #41

Merged
merged 5 commits into from
Jul 12, 2024

Conversation

vin0110
Copy link
Contributor

@vin0110 vin0110 commented Jul 11, 2024

The original code was producing the following error (truncated):

    parsed_value = self.format.parse_value(self.text)
  File "/Users/vin/.../venv/lib/python3.9/site-packages/ixbrlparse/components/formats.py", line 97, in parse_
value
    return w2n.word_to_num(value)
  File "/Users/vin/.../venv/lib/python3.9/site-packages/word2number/w2n.py", line 154, in word_to_num
    raise ValueError("No valid number words found! Please enter a valid number word (eg. two million twenty three tho
usand and forty nine)")
ValueError: No valid number words found! Please enter a valid number word (eg. two million twenty three thousand and
forty nine)

The value being parsed had whitespace around the word none.

@drkane
Copy link
Member

drkane commented Jul 12, 2024

Looks great thanks - I've added a test to cover the case you've described. (apologies for the multiple additional commits - I'm having some trouble testing on python 3.13 so I've removed those tests so I can merge).

@drkane drkane merged commit 9acc9f0 into kanedata:main Jul 12, 2024
6 checks passed
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.

2 participants