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

Unexpected change with type hints not returning as specified type #4933

Closed
dsmmcken opened this issue Dec 11, 2023 · 0 comments · Fixed by #4953
Closed

Unexpected change with type hints not returning as specified type #4933

dsmmcken opened this issue Dec 11, 2023 · 0 comments · Fixed by #4953
Assignees
Labels
bug Something isn't working

Comments

@dsmmcken
Copy link
Contributor

If I type hint as an int, I am unexpectedly getting back a numpy.int64. If I don't type hint at all I get an int.

from deephaven import empty_table
def my_type(x):
   print(type(x))
t = empty_table(1).update(["x = i", "test = my_type(x)"])
>>> <class 'int'>

from deephaven import empty_table
def my_type(x:int): # note typing
   print(type(x))
t = empty_table(1).update(["x = i", "test = my_type(x)"])
>>> <class 'numpy.int64'>

Note, same goes for float.

@dsmmcken dsmmcken added bug Something isn't working triage labels Dec 11, 2023
@jmao-denver jmao-denver self-assigned this Dec 11, 2023
@jmao-denver jmao-denver added this to the December 2023 milestone Dec 11, 2023
dsmmcken added a commit to deephaven/deephaven-plugins that referenced this issue Dec 11, 2023
Better type hinting support means this was now actually triggering an error. However, it is currently returning numpy types, which is a bug in core. Initial random.seed(seed) now prints this error, and is expected to be fixed in next release.

> DeprecationWarning: Seeding based on hashing is deprecated
since Python 3.9 and will be removed in a subsequent version. The only
supported seed types are: None, int, float, str, bytes, and bytearray.

See: deephaven/deephaven-core#4933
dsmmcken added a commit to deephaven/deephaven-plugins that referenced this issue Dec 11, 2023
Better type hinting support means this mistake was now actually
triggering an error.

Engine is currently returning numpy types instead of python types, which
is a bug in core. Initial random.seed(seed) is printing this error
because of the numpy.int64 type, but is expected to be fixed in the next
dhc release.

> DeprecationWarning: Seeding based on hashing is deprecated
since Python 3.9 and will be removed in a subsequent version. The only
supported seed types are: None, int, float, str, bytes, and bytearray.

See: deephaven/deephaven-core#4933
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants