Skip to content

Commit

Permalink
Give more help for strict param.
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu committed Feb 9, 2024
1 parent 959488a commit 1236401
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,15 @@ def read_from_dir(cls, catalog_base_dir: FilePointer, storage_options: dict = No

@classmethod
def read_from_file(
cls, metadata_file: FilePointer, strict=False, storage_options: dict = None
cls, metadata_file: FilePointer, strict: bool = False, storage_options: dict = None
) -> PartitionJoinInfo:
"""Read partition join info from a `_metadata` file to create an object
Args:
metadata_file (FilePointer): FilePointer to the `_metadata` file
storage_options (dict): dictionary that contains abstract filesystem credentials
strict (bool): use strict parsing of _metadata file. this is slower, but
gives more helpful error messages in the case of invalid data.
Returns:
A `PartitionJoinInfo` object with the data from the file
Expand All @@ -189,13 +191,15 @@ def read_from_file(

@classmethod
def _read_from_metadata_file(
cls, metadata_file: FilePointer, strict=False, storage_options: dict = None
cls, metadata_file: FilePointer, strict: bool = False, storage_options: dict = None
) -> pd.DataFrame:
"""Read partition join info from a `_metadata` file to create an object
Args:
metadata_file (FilePointer): FilePointer to the `_metadata` file
storage_options (dict): dictionary that contains abstract filesystem credentials
strict (bool): use strict parsing of _metadata file. this is slower, but
gives more helpful error messages in the case of invalid data.
Returns:
A `PartitionJoinInfo` object with the data from the file
Expand Down
8 changes: 6 additions & 2 deletions src/hipscat/catalog/partition_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,15 @@ def read_from_dir(cls, catalog_base_dir: FilePointer, storage_options: dict = No

@classmethod
def read_from_file(
cls, metadata_file: FilePointer, strict=False, storage_options: dict = None
cls, metadata_file: FilePointer, strict: bool = False, storage_options: dict = None
) -> PartitionInfo:
"""Read partition info from a `_metadata` file to create an object
Args:
metadata_file (FilePointer): FilePointer to the `_metadata` file
storage_options (dict): dictionary that contains abstract filesystem credentials
strict (bool): use strict parsing of _metadata file. this is slower, but
gives more helpful error messages in the case of invalid data.
Returns:
A `PartitionInfo` object with the data from the file
Expand All @@ -162,13 +164,15 @@ def read_from_file(

@classmethod
def _read_from_metadata_file(
cls, metadata_file: FilePointer, strict=False, storage_options: dict = None
cls, metadata_file: FilePointer, strict: bool = False, storage_options: dict = None
) -> List[HealpixPixel]:
"""Read partition info list from a `_metadata` file.
Args:
metadata_file (FilePointer): FilePointer to the `_metadata` file
storage_options (dict): dictionary that contains abstract filesystem credentials
strict (bool): use strict parsing of _metadata file. this is slower, but
gives more helpful error messages in the case of invalid data.
Returns:
A `PartitionInfo` object with the data from the file
Expand Down

0 comments on commit 1236401

Please sign in to comment.