From 70ddf38c9a41a913100c40f86f5710b467990d60 Mon Sep 17 00:00:00 2001 From: Eric Pinzur Date: Tue, 26 Sep 2023 15:54:51 +0200 Subject: [PATCH] fix lint --- python/pysrc/kaskada/sources/arrow.py | 6 +++--- python/pysrc/kaskada/sources/source.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/pysrc/kaskada/sources/arrow.py b/python/pysrc/kaskada/sources/arrow.py index 1a8b15b9b..ee7febc40 100644 --- a/python/pysrc/kaskada/sources/arrow.py +++ b/python/pysrc/kaskada/sources/arrow.py @@ -1,7 +1,6 @@ """Provide sources based on PyArrow, including Pandas and CSV.""" from __future__ import annotations -import os from io import BytesIO from typing import Optional @@ -309,6 +308,7 @@ async def add_string(self, csv_string: str | BytesIO) -> None: for batch in content.to_batches(): await self._ffi_table.add_pyarrow(batch) + class JsonlFile(Source): """Source reading data from line-delimited JSON files using PyArrow.""" @@ -356,7 +356,7 @@ async def create( schema: Optional[pa.Schema] = None, grouping_name: Optional[str] = None, time_unit: Optional[TimeUnit] = None, - ) -> JsonlString: + ) -> JsonlFile: """Create a source reading a line-delimited JSON file. Args: @@ -401,6 +401,7 @@ async def add_file(self, path: str) -> None: for batch in batches.to_batches(): await self._ffi_table.add_pyarrow(batch) + class JsonlString(Source): """Source reading data from line-delimited JSON strings using PyArrow.""" @@ -558,7 +559,6 @@ async def create( time_unit: The unit of the time column. One of `ns`, `us`, `ms`, or `s`. If not specified (and not specified in the data), nanosecond will be assumed. """ - path = Source._get_absolute_path(path) if schema is None: diff --git a/python/pysrc/kaskada/sources/source.py b/python/pysrc/kaskada/sources/source.py index 67dfeeb82..851821bc4 100644 --- a/python/pysrc/kaskada/sources/source.py +++ b/python/pysrc/kaskada/sources/source.py @@ -92,7 +92,7 @@ def _validate_column(field_name: Optional[str], schema: pa.Schema) -> None: raise ValueError(f"Column: {field_name!r} must be non-nullable") @staticmethod - def _get_absolute_path(path: Optional[str]) -> str|None: + def _get_absolute_path(path: Optional[str]) -> str | None: if path is None or path.startswith("/"): return path return os.getcwd() + "/" + path