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

LocalTime Column Error with ui.component #6057

Closed
dgodinez-dh opened this issue Sep 12, 2024 · 1 comment · Fixed by #6063
Closed

LocalTime Column Error with ui.component #6057

dgodinez-dh opened this issue Sep 12, 2024 · 1 comment · Fixed by #6063
Assignees
Labels
barrage bug Something isn't working core Core development tasks jsapi
Milestone

Comments

@dgodinez-dh
Copy link
Contributor

When I create a table with a LocalTime column and wrap it in @ui.component it throws an exception. Here is example code:

from deephaven import empty_table, ui

@ui.component
def test_local_time(table):
    return table;

my_local_time_table = empty_table(1).update(
    ["LocalTime1 = '10:15:30.46'"]
)
my_local_time_componant=test_local_time(my_local_time_table)

Here is the exception:

dh-internal.js:1 Uncaught Error: java.lang.IllegalArgumentException: Unsupported Time unit: NANOSECOND
    at IllegalArgumentException_0.createError (dh-core.js:1464:10)
    at IllegalArgumentException_0.initializeBackingError (dh-core.js:1490:46)
    at IllegalArgumentException_0.Throwable_0 (dh-core.js:1421:8)
    at IllegalArgumentException_0.Exception_1 (dh-core.js:1515:18)
    at IllegalArgumentException_0.RuntimeException_1 (dh-core.js:1533:18)
    at new IllegalArgumentException_0 (dh-core.js:1547:25)
    at Object.$getReader (dh-core.js:21344:30)
    at Object.$parseFrom (dh-core.js:21003:28)
    at Object.$onFlightData (dh-core.js:27991:22)
    at Function.apply_135 (dh-core.js:28156:11)
    at lambda (dh-core.js:193:22)
    at dh-internal.js:1:321778
    at Array.forEach (<anonymous>)
    at dh-internal.js:1:321757
    at dh-internal.js:1:11539
    at Array.forEach (<anonymous>)
    at e.rawOnMessage (dh-internal.js:1:11501)
    at dh-internal.js:1:9314
    at Array.forEach (<anonymous>)
    at e.onTransportChunk (dh-internal.js:1:9189)
    at Object.$onMessage (dh-core.js:24405:35)
    at MultiplexedWebsocketTransport$3methodref$onMessage$Type.handleEvent_2 [as handleEvent] (dh-core.js:24549:10)

Which is followed by this exception:

Uncaught Error: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at IndexOutOfBoundsException_0.createError (dh-core.js:1464:10)
    at IndexOutOfBoundsException_0.initializeBackingError (dh-core.js:1490:46)
    at IndexOutOfBoundsException_0.Throwable_0 (dh-core.js:1421:8)
    at IndexOutOfBoundsException_0.Exception_1 (dh-core.js:1515:18)
    at IndexOutOfBoundsException_0.RuntimeException_1 (dh-core.js:1533:18)
    at new IndexOutOfBoundsException_0 (dh-core.js:39957:25)
    at Object.checkCriticalElementIndex (dh-core.js:49476:16)
    at Object.$get_34 (dh-core.js:44137:7)
    at Object.$parseFrom (dh-core.js:21049:55)
    at Object.$onFlightData (dh-core.js:27991:22)
    at Function.apply_135 (dh-core.js:28156:11)
    at lambda (dh-core.js:193:22)
    at dh-internal.js:1:321778
    at Array.forEach (<anonymous>)
    at dh-internal.js:1:321757
    at dh-internal.js:1:11539
    at Array.forEach (<anonymous>)
    at e.rawOnMessage (dh-internal.js:1:11501)
    at dh-internal.js:1:9314
    at Array.forEach (<anonymous>)
    at e.onTransportChunk (dh-internal.js:1:9189)
    at Object.$onMessage (dh-core.js:24405:35)
    at MultiplexedWebsocketTransport$3methodref$onMessage$Type.handleEvent_2 [as handleEvent] (dh-core.js:24549:10)
@dgodinez-dh dgodinez-dh added bug Something isn't working triage labels Sep 12, 2024
@rcaudy rcaudy added core Core development tasks and removed triage labels Sep 12, 2024
@rcaudy rcaudy added this to the 0.37.0 milestone Sep 12, 2024
@niloc132
Copy link
Member

LocalDate has a similar issue, here's the sample updated to include LocalDate values, and test nulls for both:

from deephaven import empty_table, ui

@ui.component
def test_local_time(table):
    return table;

my_local_time_table = empty_table(10).update(
    [
        "LocalTime1 = i % 2 == 0 ? '10:15:30.46' : null",
        "LocalDate1 = i % 2 == 1 ? '2020-08-04' : null"
    ]
)
my_local_time_componant=test_local_time(my_local_time_table)

niloc132 added a commit to niloc132/deephaven-core that referenced this issue Sep 13, 2024
niloc132 added a commit to niloc132/deephaven-core that referenced this issue Sep 13, 2024
Also removes preview for these types, so they are rendered consistently
in the client.

Fixes deephaven#6057
niloc132 added a commit that referenced this issue Sep 13, 2024
Also removes preview for these types, so they are rendered consistently
in the client.

Fixes #6057
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
barrage bug Something isn't working core Core development tasks jsapi
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants