Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Feb 4, 2022
1 parent 29222c9 commit 199c4e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Integrations/python/deephaven/pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
class PandasPluginRegistration(Registration):
@classmethod
def register_into(clscls, callback: Registration.Callback) -> None:
callback.register(pandas_as_table.PandasDataFrameSerializer)
callback.register(pandas_as_table.PandasDataFrameSerializer)
Original file line number Diff line number Diff line change
Expand Up @@ -680,34 +680,16 @@ public Promise<JsTable> getTable(JsVariableDefinition varDef, @Nullable Boolean
});
}

public Promise<JsTable> getPandas(JsVariableDefinition varDef) {
return whenServerReady("get a pandas table").then(serve -> {
JsLog.debug("innerGetPandasTable", varDef.getTitle(), " started");
return newState(info,
(c, cts, metadata) -> {
JsLog.debug("performing fetch for ", varDef.getTitle(), " / ", cts,
" (" + LazyString.of(cts::getHandle), ")");
throw new UnsupportedOperationException("getPandas");

}, "fetch pandas table " + varDef.getTitle()).then(cts -> {
JsLog.debug("innerGetPandasTable", varDef.getTitle(), " succeeded ", cts);
JsTable table = new JsTable(this, cts);
return Promise.resolve(table);
});
});
}

@SuppressWarnings({"unchecked", "rawtypes"})
public Promise<Object> getObject(JsVariableDefinition definition) {
public Promise<?> getObject(JsVariableDefinition definition) {
if (JsVariableChanges.TABLE.equals(definition.getType())) {
return (Promise) getTable(definition, null);
return getTable(definition, null);
} else if (JsVariableChanges.FIGURE.equals(definition.getType())) {
return (Promise) getFigure(definition);
return getFigure(definition);
} else if (JsVariableChanges.PANDAS.equals(definition.getType())) {
return getWidget(definition)
.then(widget -> widget.getExportedObjects()[0].fetch());
} else {
return (Promise) getWidget(definition);
return getWidget(definition);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public String getType() {
}

@JsMethod
public Promise<Object> fetch() {
public Promise<?> fetch() {
if (getType().equals(JsVariableChanges.TABLE)) {
return Callbacks.<ExportedTableCreationResponse, Object>grpcUnaryPromise(c -> {
connection.tableServiceClient().getExportedTableCreationResponse(ticket.getTicket(),
Expand Down

0 comments on commit 199c4e1

Please sign in to comment.