Skip to content

Commit ca647b7

Browse files
authored
refactor(libcommon): remove unused hf_token in parquet_utils (#3249)
refactor(libcommon): remove unused hf_token in `parquet_utils`
1 parent d35ae2b commit ca647b7

File tree

5 files changed

+0
-15
lines changed

5 files changed

+0
-15
lines changed

libs/libcommon/src/libcommon/parquet_utils.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ class ParquetIndexWithMetadata:
189189
num_bytes: list[int]
190190
num_rows: list[int]
191191
httpfs: HTTPFileSystem
192-
hf_token: Optional[str]
193192
max_arrow_data_in_memory: int
194193
partial: bool
195194

@@ -458,7 +457,6 @@ def from_parquet_metadata_items(
458457
features: Optional[Features],
459458
parquet_metadata_directory: StrPath,
460459
httpfs: HTTPFileSystem,
461-
hf_token: Optional[str],
462460
max_arrow_data_in_memory: int,
463461
unsupported_features: list[FeatureType] = [],
464462
) -> "ParquetIndexWithMetadata":
@@ -503,7 +501,6 @@ def from_parquet_metadata_items(
503501
num_bytes=num_bytes,
504502
num_rows=num_rows,
505503
httpfs=httpfs,
506-
hf_token=hf_token,
507504
max_arrow_data_in_memory=max_arrow_data_in_memory,
508505
partial=partial,
509506
)
@@ -516,7 +513,6 @@ def __init__(
516513
config: str,
517514
split: str,
518515
httpfs: HfFileSystem,
519-
hf_token: Optional[str],
520516
parquet_metadata_directory: StrPath,
521517
max_arrow_data_in_memory: int,
522518
unsupported_features: list[FeatureType] = [],
@@ -526,15 +522,13 @@ def __init__(
526522
self.split = split
527523
self.httpfs = httpfs
528524
self.parquet_index = self._init_parquet_index(
529-
hf_token=hf_token,
530525
parquet_metadata_directory=parquet_metadata_directory,
531526
max_arrow_data_in_memory=max_arrow_data_in_memory,
532527
unsupported_features=unsupported_features,
533528
)
534529

535530
def _init_parquet_index(
536531
self,
537-
hf_token: Optional[str],
538532
parquet_metadata_directory: StrPath,
539533
max_arrow_data_in_memory: int,
540534
unsupported_features: list[FeatureType] = [],
@@ -566,7 +560,6 @@ def _init_parquet_index(
566560
features=features,
567561
parquet_metadata_directory=parquet_metadata_directory,
568562
httpfs=self.httpfs,
569-
hf_token=hf_token,
570563
max_arrow_data_in_memory=max_arrow_data_in_memory,
571564
unsupported_features=unsupported_features,
572565
)
@@ -623,11 +616,9 @@ def __init__(
623616
max_arrow_data_in_memory: int,
624617
unsupported_features: list[FeatureType] = [],
625618
all_columns_supported_datasets_allow_list: Union[Literal["all"], list[str]] = "all",
626-
hf_token: Optional[str] = None,
627619
):
628620
self.parquet_metadata_directory = parquet_metadata_directory
629621
self.httpfs = httpfs
630-
self.hf_token = hf_token
631622
self.max_arrow_data_in_memory = max_arrow_data_in_memory
632623
self.unsupported_features = unsupported_features
633624
self.all_columns_supported_datasets_allow_list = all_columns_supported_datasets_allow_list
@@ -649,7 +640,6 @@ def get_rows_index(
649640
config=config,
650641
split=split,
651642
httpfs=self.httpfs,
652-
hf_token=self.hf_token,
653643
parquet_metadata_directory=self.parquet_metadata_directory,
654644
max_arrow_data_in_memory=self.max_arrow_data_in_memory,
655645
unsupported_features=unsupported_features,

libs/libcommon/tests/test_parquet_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ def rows_index_with_too_big_rows(
378378
dataset_sharded_with_config_parquet_metadata: dict[str, Any],
379379
) -> Generator[RowsIndex, None, None]:
380380
indexer = Indexer(
381-
hf_token="token",
382381
parquet_metadata_directory=parquet_metadata_directory,
383382
httpfs=HTTPFileSystem(),
384383
max_arrow_data_in_memory=1,
@@ -393,7 +392,6 @@ def indexer(
393392
parquet_metadata_directory: StrPath,
394393
) -> Indexer:
395394
return Indexer(
396-
hf_token="token",
397395
parquet_metadata_directory=parquet_metadata_directory,
398396
httpfs=HTTPFileSystem(),
399397
max_arrow_data_in_memory=9999999999,

services/rows/src/rows/routes/rows.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def create_rows_endpoint(
5454
storage_clients: Optional[list[StorageClient]] = None,
5555
) -> Endpoint:
5656
indexer = Indexer(
57-
hf_token=hf_token,
5857
parquet_metadata_directory=parquet_metadata_directory,
5958
httpfs=HTTPFileSystem(headers={"authorization": f"Bearer {hf_token}"}),
6059
max_arrow_data_in_memory=max_arrow_data_in_memory,

services/worker/src/worker/job_runners/split/first_rows.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ def __init__(
294294
self.first_rows_config = app_config.first_rows
295295
self.parquet_metadata_directory = parquet_metadata_directory
296296
self.indexer = Indexer(
297-
hf_token=self.app_config.common.hf_token,
298297
parquet_metadata_directory=parquet_metadata_directory,
299298
httpfs=HTTPFileSystem(headers={"authorization": f"Bearer {self.app_config.common.hf_token}"}),
300299
unsupported_features=[],

services/worker/tests/job_runners/config/test_parquet_metadata.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ def test_ParquetIndexWithMetadata_query(
395395
num_rows=[num_rows],
396396
num_bytes=[num_bytes],
397397
httpfs=httpfs,
398-
hf_token=CI_USER_TOKEN,
399398
max_arrow_data_in_memory=999999999,
400399
partial=False,
401400
)

0 commit comments

Comments
 (0)