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

Add a parameter to be able to force null_values in TypeTester() #745

Merged
merged 6 commits into from Jul 14, 2021

Conversation

lcorbasson
Copy link
Contributor

Rationale:
null_values is a parameter common to all agate types. Being able to specify it directly in the constructor avoids any use of private members like _possible_types to get the effect of choosing the list of null values while keeping agate's default order of types.

…stance() returns None

(no idea why it does sometimes: buggy dll?)

Workaround: in case of failure, avoid PyICU use in parsedatetime

Traceback below:
    column_types = TypeTester(force=column_types)
  File "/usr/local/lib/python3.8/site-packages/agate/type_tester.py", line 68, in __init__
    Date(),
  File "/usr/local/lib/python3.8/site-packages/agate/data_types/date.py", line 34, in __init__
    self._constants = parsedatetime.Constants(localeID=self.locale, usePyICU=True)
  File "/usr/local/lib/python3.8/site-packages/parsedatetime/__init__.py", line 2381, in __init__
    self.locale = get_icu(self.localeID)
  File "/usr/local/lib/python3.8/site-packages/parsedatetime/pdt_locales/icu.py", line 100, in get_icu
    result['timeFormats'][x] = icu_tf[x].toPattern()
AttributeError: 'NoneType' object has no attribute 'toPattern'
…teTimeInstance() returns None"

This reverts commit 15296f1.
@jpmckinney jpmckinney merged commit ba92da5 into wireservice:master Jul 14, 2021
@jpmckinney
Copy link
Member

Thanks!

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.

None yet

2 participants