Skip to content

Conversation

@bruno-f-cruz
Copy link
Member

@bruno-f-cruz bruno-f-cruz commented Apr 1, 2025

Fixes an issue where the inner callable from _compose_parser was not allowing the data input to be optional.

def _compose_parser(
f: Callable[[DataFrame], DataFrame],
g: Callable[..., DataFrame],
params: _ReaderParams,
) -> Callable[..., DataFrame]:
def parser(
data,
columns: Optional[Axes] = None,
epoch: Optional[datetime] = params.epoch,
keep_type: bool = params.keep_type,
):
df = g(data, columns, epoch, keep_type)
result = f(df)
type_col = df.get(MessageType.__name__)
if type_col is not None:
result[MessageType.__name__] = type_col
return result
return parser

This allows g aka _create_register_reader to take care of the path inference logic

Closes #45

@bruno-f-cruz bruno-f-cruz requested a review from glopesdev April 1, 2025 21:34
@bruno-f-cruz
Copy link
Member Author

@glopesdev Some notes:

  1. Not sure this is the best way to create the unit test, but it is the one I think reuses the assets in tests the most efficiently.
  2. I ended up fixing a pyright test fail due to an internal import of a pandas type. I checked and I don't think that there is a way to avoid the import, so I just muted it. It may be worth generating a uv.lock file for this library as I think the problem likely stems from a recent upgrade to pyright.

@bruno-f-cruz bruno-f-cruz added the critical This is a blocking issue affecting all users label Apr 1, 2025
@glopesdev glopesdev merged commit f6f4c53 into main Apr 2, 2025
12 checks passed
@glopesdev glopesdev added the fix Pull request that fixes an issue label Apr 2, 2025
@glopesdev glopesdev deleted the fix-parser branch April 2, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

critical This is a blocking issue affecting all users fix Pull request that fixes an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register Reader fails to find file automatically

3 participants