Skip to content

Commit

Permalink
Fix excluded binary column in rows (#3108)
Browse files Browse the repository at this point in the history
* fix excluded binary column in rows

* add truncated finary for foursquare/fsq-os-places

* style
  • Loading branch information
lhoestq authored Dec 3, 2024
1 parent 1886a85 commit 282364e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions services/rows/src/rows/routes/rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging
from typing import Literal, Optional, Union

from datasets import Features
from datasets.table import cast_table_to_features
from fsspec.implementations.http import HTTPFileSystem
from libapi.authentication import auth_check
Expand Down Expand Up @@ -96,13 +97,16 @@ async def rows_endpoint(request: Request) -> Response:
with StepProfiler(method="rows_endpoint", step="query the rows"):
try:
truncated_columns: list[str] = []
if dataset == "Major-TOM/Core-S2L2A":
if dataset == "Major-TOM/Core-S2L2A" or dataset == "foursquare/fsq-os-places":
pa_table, truncated_columns = rows_index.query_truncated_binary(
offset=offset, length=length
)
else:
pa_table = rows_index.query(offset=offset, length=length)
pa_table = cast_table_to_features(pa_table, rows_index.parquet_index.features)
features = Features(
{col: rows_index.parquet_index.features[col] for col in pa_table.column_names}
)
pa_table = cast_table_to_features(pa_table, features)
except TooBigRows as err:
raise TooBigContentError(str(err)) from None
with StepProfiler(method="rows_endpoint", step="transform to a list"):
Expand Down

0 comments on commit 282364e

Please sign in to comment.