-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Cannot create Time object from a Column #3648
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
Conversation
|
I guess we're back to the problem that |
(and not as a dimensionless Quantity).
|
@taldcroft - this fixes it locally, and adds regression tests. |
|
Hmm, this is not good: when I give |
|
OK, that was just a "out-of-space" issue on |
|
Why rely on duck-typing? Why not just an isinstance there? |
|
@embray - Changing to |
|
Couldn't we do |
|
@astrofrog - why bother? If something has a |
|
@taldcroft - finally appveyor got to it as well, and everything now seems OK. |
|
Would help if there were an ABC that mean "Thing with units". Maybe call it |
|
@embray - yes, that would be a good solution; I am becoming more and more enchanted with metaclasses, where someone can, if they wish, register a certain type of object, thus guaranteeing that it behaves like it. I think it should be discussed separately of this PR, however (let's get the bug fixed!): see #3650. |
Fix regression when initializing Time from a Column with no unit set
|
Thanks @mhvk! |
Fix regression when initializing Time from a Column with no unit set
This is a regression introduced in 1.0. The problem is here
I'm not a huge fan of duck-typing by simply looking for a
toattribute (and hoping that object is sufficiently Quantity-like), but given the existing code the best way out might just be to handle the possibility of aunitattribute that is None.@mhvk