Skip to content

Commit

Permalink
Fix to query store columns when fetching empty result (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikfoss authored Jan 23, 2025
1 parent a23ec95 commit be49de9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
from adapta.utils import chunk_list, rate_limit
from adapta.utils.metaframe import MetaFrame, concat
from adapta.storage.distributed_object_store.v3.datastax_astra._model_mappers import get_mapper
from adapta.schema_management.schema_entity import PythonSchemaEntity

TModel = TypeVar("TModel") # pylint: disable=C0103

Expand Down Expand Up @@ -293,7 +294,9 @@ def to_frame(
return MetaFrame(
[dict(v.items()) for v in list(apply(model, key_column_filter, columns_to_select))],
convert_to_polars=lambda x: polars.DataFrame(x, schema=select_columns),
convert_to_pandas=lambda x: pandas.DataFrame(x, columns=select_columns),
convert_to_pandas=lambda x: pandas.DataFrame(
x, columns=select_columns or PythonSchemaEntity(model).get_field_names()
),
)

assert (
Expand Down

0 comments on commit be49de9

Please sign in to comment.