We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Duckling with latent entities enabled can produce invalid datetime for python.
To Reproduce
Run the following code:
from dialogy.plugins import DucklingPlugin duckling_plugin = DucklingPlugin(dimensions=["time"]) x = duckling_plugin._get_entities_concurrent(["10000"], use_latent=True) # here x would be: [[{'body': '10000', 'start': 0, 'value': {'values': [{'value': '10000-01-01T00:00:00.000+00:00', 'grain': 'year', 'type': 'value'}], 'value': '10000-01-01T00:00:00.000+00:00', 'grain': 'year', 'type': 'value'}, 'end': 5, 'dim': 'time', 'latent': True}]] # now running TimeEntity.from_duckling(x[0][0], 1).get_value() # returns --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Input In [7], in <cell line: 1>() ----> 1 t.get_value() File ~/Programs/pythoncode/dialogy/dialogy/types/entity/time/__init__.py:113, in TimeEntity.get_value(self) 96 """ 97 Return the date string in ISO format from the dictionary passed 98 (...) 110 :rtype: Optional[datetime] 111 """ 112 entity_date_value = super().get_value() --> 113 return dt_from_isoformat(entity_date_value) File ~/Programs/pythoncode/dialogy/dialogy/types/entity/time/__init__.py:69, in dt_from_isoformat(iso_datetime) 65 def dt_from_isoformat(iso_datetime: str) -> datetime: 66 """ 67 Converts an ISO-formatted datetime string to a datetime object. 68 """ ---> 69 return datetime.fromisoformat(iso_datetime) ValueError: Invalid isoformat string: '10000-01-01T00:00:00.000+00:00'
Expected behavior We shouldn't return entities that can't be parsed.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
fix: #148
eae1904
b98efc1
No branches or pull requests
Describe the bug
Duckling with latent entities enabled can produce invalid datetime for python.
To Reproduce
Run the following code:
Expected behavior
We shouldn't return entities that can't be parsed.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: