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

Bug in extract_datetime return values #142

Open
ChanceNCounter opened this issue Nov 2, 2020 · 2 comments
Open

Bug in extract_datetime return values #142

ChanceNCounter opened this issue Nov 2, 2020 · 2 comments
Assignees
Labels
bug Something isn't working en relates to english language

Comments

@ChanceNCounter
Copy link
Contributor

extract_datetime_en() (at minimum, and possibly other languages) returns a tuple when it's successful, but it returns None when it doesn't find a datetime.

@JarbasAl has discovered that this (obviously) fails to unpack. This can (and should) be resolved by returning (None, utterance) when no datetime is found, just as it returns (Datetime, remainder) when successful.

However, as @JarbasAl pointed out, some folks in the wild might be wrapping the problem:

if extract_datetime(...):
  datething = ...

so simply removing the None output could break something, somewhere.

Hence, we'd like to slap a big ol' DeprecationWarning on this and fix it in, say, four alpha-minor or one "major" (minor) release.

@ChanceNCounter ChanceNCounter added bug Something isn't working en relates to english language labels Nov 2, 2020
@JarbasAl
Copy link
Collaborator

JarbasAl commented Nov 5, 2020

alarm skill handles this case exactly as we propose

when, utt_no_datetime = extract_datetime(utt) or (None, utt)

but it should not break with proposed changes

@ChanceNCounter
Copy link
Contributor Author

That's a relief!

@JarbasAl JarbasAl removed their assignment Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working en relates to english language
Projects
None yet
Development

No branches or pull requests

2 participants