deephaven-core icon indicating copy to clipboard operation
deephaven-core copied to clipboard

Method for getting a specific column's info in Python

Open rbasralian opened this issue 1 year ago • 3 comments

In Python we no equivalent to .getDefinition().getColumn("MyColumn") in Java, so it's a pain if you have a question like "what is the data type of MyColumn?" or "Is MyColumn a partitioning column?"

There should be a .get_column(col_name: str) or something similar

rbasralian avatar Jun 24 '24 16:06 rbasralian

pydoc on https://deephaven.io/core/pydoc/code/deephaven.table.html#deephaven.table.Table.columns seems lacking. IMO, if we were re-writing .columns, I think it would be better exposed as a dict. As it stands today, we might want a different value? .dict_columns["Foo"]?

devinrsmith avatar Jun 24 '24 16:06 devinrsmith

That sound reasonable to me. I would slightly prefer columns_dict over dict_columns because that would be more in line with the Java method names:

public List<ColumnDefinition<?>> getColumns()
public Map<String, ColumnDefinition<?>> getColumnNameMap()

rbasralian avatar Jun 24 '24 17:06 rbasralian

https://github.com/deephaven/deephaven-core/pull/5892 is poc

devinrsmith avatar Aug 03 '24 23:08 devinrsmith