Skip to content

Conversation

@cpwright
Copy link
Contributor

No description provided.

@cpwright cpwright requested review from mofojed and niloc132 August 20, 2025 20:59
@cpwright cpwright force-pushed the nightly/cpw/input-table-experiments branch 2 times, most recently from c85adfa to 7c93440 Compare August 28, 2025 21:40
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we could get a structured object back with the errors that would be better long-term; not only could we highlight the cells that have the errors, it would be essential if we ever want to internationalize our application.
Would eliminate much of the string building/formatting going on in this PR.

@cpwright cpwright force-pushed the nightly/cpw/input-table-experiments branch from 7c93440 to a5dba61 Compare September 17, 2025 10:33
@github-actions
Copy link
Contributor

github-actions bot commented Sep 17, 2025

No docs changes detected for 67fbe8f

* </p>
* .
*/
public interface StructuredError {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason this needs to be an interface? Seems like we can just have a concrete class (like StructuredErrorImpl).

Comment on lines 109 to 110
GrpcUtil.safelyError(responseObserver, StatusProto.toStatusException(status));
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this compare to throw StatusProto.toStatusRuntimeException(status);?

* </p>
*/
@TestUseOnly
public class RangeValidatingInputTable implements InputTableUpdater {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call make with an input table and an integer column and a min and a max

that's the easiest way to make one, start testing it out

@cpwright cpwright self-assigned this Dec 22, 2025
@cpwright cpwright changed the title WIP: Introduce structured errors for input table updates. feat: DH-10139: Introduce structured errors for input table updates. Dec 22, 2025
@cpwright cpwright marked this pull request as ready for review December 22, 2025 14:30
@cpwright cpwright enabled auto-merge (squash) December 22, 2025 16:30
niloc132
niloc132 previously approved these changes Dec 30, 2025
Comment on lines 1 to 21
#
# Copyright (c) 2016-2025 Deephaven Data Labs and Patent Pending
#

"""Demo how to chain table operations."""

from pydeephaven import Session, Table, DHError
from pydeephaven.table import InputTable
import pyarrow as pa
from datetime import datetime
import time
from grpc_status import rpc_status
import grpc
from google.protobuf.any_pb2 import Any
from deephaven_core.proto.inputtable_pb2 import InputTableValidationErrorList

err = None
stat = None
err_list = None

def main():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. doc string is wrong
  2. do we want to add a test case in addition to this example?
  3. is formal documentation needed ( a link to the demo could suffice)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I updated the docstring to be more helpful.
  2. keyed_input_t = self.session.input_table(schema=schema, key_cols="f1")
    has a test of an input table addition already
  3. There are no production grade validations available from Core. The input table operations remain compatible, without any need to change the Python documentation.

Comment on lines 64 to 82
except DHError as dhe:
err = dhe
parent = dhe.__cause__
while parent is not None:
if isinstance(parent, grpc.Call):
stat = rpc_status.from_call(parent)
parent = None

for detail in stat.details:
if detail.type_url == "type.googleapis.com/" + InputTableValidationErrorList.DESCRIPTOR.full_name:
el = InputTableValidationErrorList()
if detail.Unpack(el):
err_list = el
else:
print("Could not unpack: " + detail)
else:
parent = parent.__cause__

raise
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a public helper function in the API to wrap all these parsing justified?

Copy link
Contributor Author

@cpwright cpwright Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is just to prove that we could extract them if we wanted. There is a formatted message passed along in the error string. But if we are to use the googlerpc status library in more places, we do want to make sure that the languages we care about work.

Copy link
Contributor

@jmao-denver jmao-denver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python changes LGTM

@cpwright cpwright merged commit 1abb24e into deephaven:main Jan 1, 2026
24 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants