diff --git a/sparrow-py/.coveragerc b/python/.coveragerc similarity index 100% rename from sparrow-py/.coveragerc rename to python/.coveragerc diff --git a/sparrow-py/.darglint b/python/.darglint similarity index 100% rename from sparrow-py/.darglint rename to python/.darglint diff --git a/sparrow-py/.flake8 b/python/.flake8 similarity index 100% rename from sparrow-py/.flake8 rename to python/.flake8 diff --git a/sparrow-py/Cargo.lock b/python/Cargo.lock similarity index 99% rename from sparrow-py/Cargo.lock rename to python/Cargo.lock index 48290ab55..8ddae2a71 100644 --- a/sparrow-py/Cargo.lock +++ b/python/Cargo.lock @@ -1959,6 +1959,22 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kaskada" +version = "0.6.0" +dependencies = [ + "arrow", + "derive_more", + "error-stack", + "futures", + "itertools 0.11.0", + "pyo3", + "pyo3-asyncio", + "sparrow-session", + "tokio", + "tracing", +] + [[package]] name = "kv-log-macro" version = "1.0.7" @@ -3839,22 +3855,6 @@ dependencies = [ "uuid 1.4.1", ] -[[package]] -name = "sparrow-py" -version = "0.1.0" -dependencies = [ - "arrow", - "derive_more", - "error-stack", - "futures", - "itertools 0.11.0", - "pyo3", - "pyo3-asyncio", - "sparrow-session", - "tokio", - "tracing", -] - [[package]] name = "sparrow-qfr" version = "0.11.0" diff --git a/sparrow-py/Cargo.toml b/python/Cargo.toml similarity index 87% rename from sparrow-py/Cargo.toml rename to python/Cargo.toml index 238eb680c..a2ffb7e63 100644 --- a/sparrow-py/Cargo.toml +++ b/python/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "sparrow-py" +name = "kaskada" authors = ["Kaskada Developers"] edition = "2021" license = "Apache-2.0" -version = "0.1.0" +version = "0.6.0" description = """ -Python library for building and executing Kaskada queries. +Python library for building and executing temporal queries. """ # This needs to be its own workspace. @@ -24,7 +24,7 @@ tokio = { version = "1.27.0", features = ["sync"] } tracing = "0.1.37" [lib] -name = "sparrow_py" +name = "kaskada" # `cdylib` is necessary to produce a shared library for Python. # This can't be used by downstream Rust code (eg., as a library). crate-type = ["cdylib"] diff --git a/sparrow-py/README.md b/python/README.md similarity index 100% rename from sparrow-py/README.md rename to python/README.md diff --git a/sparrow-py/codecov.yml b/python/codecov.yml similarity index 100% rename from sparrow-py/codecov.yml rename to python/codecov.yml diff --git a/sparrow-py/docs/.gitignore b/python/docs/.gitignore similarity index 100% rename from sparrow-py/docs/.gitignore rename to python/docs/.gitignore diff --git a/sparrow-py/docs/source/_extensions/gallery_directive.py b/python/docs/source/_extensions/gallery_directive.py similarity index 100% rename from sparrow-py/docs/source/_extensions/gallery_directive.py rename to python/docs/source/_extensions/gallery_directive.py diff --git a/sparrow-py/docs/source/_static/favicon.png b/python/docs/source/_static/favicon.png similarity index 100% rename from sparrow-py/docs/source/_static/favicon.png rename to python/docs/source/_static/favicon.png diff --git a/sparrow-py/docs/source/_templates/autosummary/class.rst b/python/docs/source/_templates/autosummary/class.rst similarity index 100% rename from sparrow-py/docs/source/_templates/autosummary/class.rst rename to python/docs/source/_templates/autosummary/class.rst diff --git a/sparrow-py/docs/source/_templates/autosummary/function.rst b/python/docs/source/_templates/autosummary/function.rst similarity index 100% rename from sparrow-py/docs/source/_templates/autosummary/function.rst rename to python/docs/source/_templates/autosummary/function.rst diff --git a/sparrow-py/docs/source/_templates/autosummary/method.rst b/python/docs/source/_templates/autosummary/method.rst similarity index 100% rename from sparrow-py/docs/source/_templates/autosummary/method.rst rename to python/docs/source/_templates/autosummary/method.rst diff --git a/sparrow-py/docs/source/concepts.md b/python/docs/source/concepts.md similarity index 100% rename from sparrow-py/docs/source/concepts.md rename to python/docs/source/concepts.md diff --git a/sparrow-py/docs/source/conf.py b/python/docs/source/conf.py similarity index 96% rename from sparrow-py/docs/source/conf.py rename to python/docs/source/conf.py index 5f4779501..c429967ea 100644 --- a/sparrow-py/docs/source/conf.py +++ b/python/docs/source/conf.py @@ -7,7 +7,7 @@ sys.path.append(str(Path(".").resolve())) -project = "sparrow-py" +project = "kaskada" author = "Kaskada Contributors" copyright = "2023, Kaskada Contributors" extensions = [ @@ -38,7 +38,7 @@ "home_page_in_toc": True, "use_issues_button": True, "repository_branch": "main", - "path_to_docs": "sparrow-py/docs/source", + "path_to_docs": "kaskada/docs/source", "icon_links": [ { "name": "GitHub", @@ -63,7 +63,7 @@ "github_user": "kaskada-ai", "github_repo": "kaskada", "github_version": "main", - "doc_path": "sparrow-py/docs/source", + "doc_path": "kaskada/docs/source", } intersphinx_mapping: Dict[str, Any] = { diff --git a/sparrow-py/docs/source/examples/index.md b/python/docs/source/examples/index.md similarity index 100% rename from sparrow-py/docs/source/examples/index.md rename to python/docs/source/examples/index.md diff --git a/sparrow-py/docs/source/guide/introduction.md b/python/docs/source/guide/introduction.md similarity index 100% rename from sparrow-py/docs/source/guide/introduction.md rename to python/docs/source/guide/introduction.md diff --git a/sparrow-py/docs/source/index.md b/python/docs/source/index.md similarity index 100% rename from sparrow-py/docs/source/index.md rename to python/docs/source/index.md diff --git a/sparrow-py/docs/source/quickstart.md b/python/docs/source/quickstart.md similarity index 83% rename from sparrow-py/docs/source/quickstart.md rename to python/docs/source/quickstart.md index 28958ee95..742766ffe 100644 --- a/sparrow-py/docs/source/quickstart.md +++ b/python/docs/source/quickstart.md @@ -15,8 +15,8 @@ Write the quick start. ``` ```{code-cell} -import sparrow_py as kt -kt.init_session() +import kaskada as kd +kd.init_session() content = "\n".join( [ "time,key,m,n", @@ -28,6 +28,6 @@ content = "\n".join( "1996-12-19T16:40:02-08:00,A,,", ] ) -source = kt.sources.CsvString(content, time_column_name="time", key_column_name="key") +source = kd.sources.CsvString(content, time_column_name="time", key_column_name="key") source.run().to_pandas() ``` \ No newline at end of file diff --git a/sparrow-py/docs/source/reference/results.md b/python/docs/source/reference/results.md similarity index 72% rename from sparrow-py/docs/source/reference/results.md rename to python/docs/source/reference/results.md index 809083d11..36ee7970d 100644 --- a/sparrow-py/docs/source/reference/results.md +++ b/python/docs/source/reference/results.md @@ -1,7 +1,7 @@ # Results ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: apidocs/ diff --git a/sparrow-py/docs/source/reference/sources.md b/python/docs/source/reference/sources.md similarity index 79% rename from sparrow-py/docs/source/reference/sources.md rename to python/docs/source/reference/sources.md index 12145d5e2..23b0865b0 100644 --- a/sparrow-py/docs/source/reference/sources.md +++ b/python/docs/source/reference/sources.md @@ -1,7 +1,7 @@ # Sources ```{eval-rst} -.. currentmodule:: sparrow_py.sources +.. currentmodule:: kaskada.sources .. autosummary:: :toctree: apidocs/sources diff --git a/sparrow-py/docs/source/reference/timestream/aggregation.md b/python/docs/source/reference/timestream/aggregation.md similarity index 93% rename from sparrow-py/docs/source/reference/timestream/aggregation.md rename to python/docs/source/reference/timestream/aggregation.md index eb7c35526..3511f21c3 100644 --- a/sparrow-py/docs/source/reference/timestream/aggregation.md +++ b/python/docs/source/reference/timestream/aggregation.md @@ -10,7 +10,7 @@ Windowed: They reflect the values within a specific [window](../windows.md). ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: ../apidocs/ diff --git a/sparrow-py/docs/source/reference/timestream/arithmetic.md b/python/docs/source/reference/timestream/arithmetic.md similarity index 93% rename from sparrow-py/docs/source/reference/timestream/arithmetic.md rename to python/docs/source/reference/timestream/arithmetic.md index fbc264cbe..6a0d2109e 100644 --- a/sparrow-py/docs/source/reference/timestream/arithmetic.md +++ b/python/docs/source/reference/timestream/arithmetic.md @@ -9,7 +9,7 @@ See the notes on the specific functions for more information. ``` ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: ../apidocs/ diff --git a/sparrow-py/docs/source/reference/timestream/collection.md b/python/docs/source/reference/timestream/collection.md similarity index 90% rename from sparrow-py/docs/source/reference/timestream/collection.md rename to python/docs/source/reference/timestream/collection.md index 0482a301f..99e579692 100644 --- a/sparrow-py/docs/source/reference/timestream/collection.md +++ b/python/docs/source/reference/timestream/collection.md @@ -3,7 +3,7 @@ Timestreams allow each point to contain a collection -- a `list` or `map` -- of elements. ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: ../apidocs/ diff --git a/sparrow-py/docs/source/reference/timestream/comparison.md b/python/docs/source/reference/timestream/comparison.md similarity index 95% rename from sparrow-py/docs/source/reference/timestream/comparison.md rename to python/docs/source/reference/timestream/comparison.md index 068595b8c..d25e3d28f 100644 --- a/sparrow-py/docs/source/reference/timestream/comparison.md +++ b/python/docs/source/reference/timestream/comparison.md @@ -11,7 +11,7 @@ To respect the semantics of `__eq__` and `__ne__`, `a == b` and `a != b` are *no ``` ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: ../apidocs/ diff --git a/sparrow-py/docs/source/reference/timestream/execution.md b/python/docs/source/reference/timestream/execution.md similarity index 79% rename from sparrow-py/docs/source/reference/timestream/execution.md rename to python/docs/source/reference/timestream/execution.md index f71e9a71a..87f06ea92 100644 --- a/sparrow-py/docs/source/reference/timestream/execution.md +++ b/python/docs/source/reference/timestream/execution.md @@ -1,7 +1,7 @@ # Execution ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: ../apidocs/ diff --git a/sparrow-py/docs/source/reference/timestream/grouping.md b/python/docs/source/reference/timestream/grouping.md similarity index 79% rename from sparrow-py/docs/source/reference/timestream/grouping.md rename to python/docs/source/reference/timestream/grouping.md index e31e5893d..47575a856 100644 --- a/sparrow-py/docs/source/reference/timestream/grouping.md +++ b/python/docs/source/reference/timestream/grouping.md @@ -1,7 +1,7 @@ # Grouping ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: ../apidocs/ diff --git a/sparrow-py/docs/source/reference/timestream/index.md b/python/docs/source/reference/timestream/index.md similarity index 65% rename from sparrow-py/docs/source/reference/timestream/index.md rename to python/docs/source/reference/timestream/index.md index 96c33321e..17a020ca0 100644 --- a/sparrow-py/docs/source/reference/timestream/index.md +++ b/python/docs/source/reference/timestream/index.md @@ -1,10 +1,10 @@ # Timestream ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada -.. autoclass:: sparrow_py.Literal -.. autoclass:: sparrow_py.Timestream +.. autoclass:: kaskada.Literal +.. autoclass:: kaskada.Timestream :exclude-members: __init__ ``` diff --git a/sparrow-py/docs/source/reference/timestream/logical.md b/python/docs/source/reference/timestream/logical.md similarity index 81% rename from sparrow-py/docs/source/reference/timestream/logical.md rename to python/docs/source/reference/timestream/logical.md index ccaf440e6..e2eeb9927 100644 --- a/sparrow-py/docs/source/reference/timestream/logical.md +++ b/python/docs/source/reference/timestream/logical.md @@ -1,7 +1,7 @@ # Logical ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: ../apidocs/ diff --git a/sparrow-py/docs/source/reference/timestream/misc.md b/python/docs/source/reference/timestream/misc.md similarity index 87% rename from sparrow-py/docs/source/reference/timestream/misc.md rename to python/docs/source/reference/timestream/misc.md index e74867e6b..9da8b49c8 100644 --- a/sparrow-py/docs/source/reference/timestream/misc.md +++ b/python/docs/source/reference/timestream/misc.md @@ -1,7 +1,7 @@ # Miscellaneous ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: ../apidocs/ diff --git a/sparrow-py/docs/source/reference/timestream/records.md b/python/docs/source/reference/timestream/records.md similarity index 91% rename from sparrow-py/docs/source/reference/timestream/records.md rename to python/docs/source/reference/timestream/records.md index 13a37ae1b..7fe5b10c1 100644 --- a/sparrow-py/docs/source/reference/timestream/records.md +++ b/python/docs/source/reference/timestream/records.md @@ -4,7 +4,7 @@ Record operations create, extract or manipulate Timestreams of records. Comparison operations produce boolean Timestreams. ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: ../apidocs/ diff --git a/sparrow-py/docs/source/reference/timestream/time.md b/python/docs/source/reference/timestream/time.md similarity index 84% rename from sparrow-py/docs/source/reference/timestream/time.md rename to python/docs/source/reference/timestream/time.md index 18ed784cd..e8fbca7a6 100644 --- a/sparrow-py/docs/source/reference/timestream/time.md +++ b/python/docs/source/reference/timestream/time.md @@ -1,7 +1,7 @@ # Time ```{eval-rst} -.. currentmodule:: sparrow_py +.. currentmodule:: kaskada .. autosummary:: :toctree: ../apidocs/ diff --git a/sparrow-py/docs/source/reference/windows.md b/python/docs/source/reference/windows.md similarity index 74% rename from sparrow-py/docs/source/reference/windows.md rename to python/docs/source/reference/windows.md index 50057fc80..007f26a12 100644 --- a/sparrow-py/docs/source/reference/windows.md +++ b/python/docs/source/reference/windows.md @@ -1,7 +1,7 @@ # Windows ```{eval-rst} -.. currentmodule:: sparrow_py.windows +.. currentmodule:: kaskada.windows .. autosummary:: :toctree: apidocs/windows/ diff --git a/sparrow-py/mypy.ini b/python/mypy.ini similarity index 100% rename from sparrow-py/mypy.ini rename to python/mypy.ini diff --git a/sparrow-py/noxfile.py b/python/noxfile.py similarity index 99% rename from sparrow-py/noxfile.py rename to python/noxfile.py index a6e1cabbc..a904b0b6f 100644 --- a/sparrow-py/noxfile.py +++ b/python/noxfile.py @@ -8,7 +8,7 @@ import nox -package = "sparrow_py" +package = "kaskada" python_versions = ["3.11", "3.10", "3.9", "3.8"] nox.needs_version = ">= 2021.6.6" nox.options.sessions = ( @@ -99,7 +99,7 @@ def coverage(session: nox.Session) -> None: @nox.session(python=python_versions[0]) def typeguard(session: nox.Session) -> None: """Runtime type checking using Typeguard.""" - install(session, groups=["typecheck"]) + install(session, groups=["typecheck", "test"]) session.run("pytest", f"--typeguard-packages={package}", *session.posargs) diff --git a/sparrow-py/poetry.lock b/python/poetry.lock similarity index 100% rename from sparrow-py/poetry.lock rename to python/poetry.lock diff --git a/sparrow-py/pyproject.toml b/python/pyproject.toml similarity index 96% rename from sparrow-py/pyproject.toml rename to python/pyproject.toml index 5f56763b9..3e5d1c318 100644 --- a/sparrow-py/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] -name = "sparrow_py" -version = "0.1.0" +name = "kaskada" +version = "0.6.0" description = "Kaskada query builder and local execution engine." authors = [] @@ -78,7 +78,7 @@ requires = ["maturin>=1,<2"] build-backend = "maturin" [project] -name = "sparrow_py" +name = "kaskada" version = "0.1.0" description = "Kaskada query builder and local execution engine." requires-python = ">=3.8,<4.0" @@ -90,7 +90,7 @@ profile = "release" # Path to the python source directory python-source = "pysrc" # Name of the Rust module in Python -module-name = "sparrow_py._ffi" +module-name = "kaskada._ffi" [tool.coverage.paths] source = ["pysrc", "*/site-packages"] diff --git a/sparrow-py/pysrc/sparrow_py/__init__.py b/python/pysrc/kaskada/__init__.py similarity index 100% rename from sparrow-py/pysrc/sparrow_py/__init__.py rename to python/pysrc/kaskada/__init__.py diff --git a/sparrow-py/pysrc/sparrow_py/_execution.py b/python/pysrc/kaskada/_execution.py similarity index 100% rename from sparrow-py/pysrc/sparrow_py/_execution.py rename to python/pysrc/kaskada/_execution.py diff --git a/sparrow-py/pysrc/sparrow_py/_ffi.pyi b/python/pysrc/kaskada/_ffi.pyi similarity index 100% rename from sparrow-py/pysrc/sparrow_py/_ffi.pyi rename to python/pysrc/kaskada/_ffi.pyi diff --git a/sparrow-py/pysrc/sparrow_py/_result.py b/python/pysrc/kaskada/_result.py similarity index 100% rename from sparrow-py/pysrc/sparrow_py/_result.py rename to python/pysrc/kaskada/_result.py diff --git a/sparrow-py/pysrc/sparrow_py/_session.py b/python/pysrc/kaskada/_session.py similarity index 97% rename from sparrow-py/pysrc/sparrow_py/_session.py rename to python/pysrc/kaskada/_session.py index 8747e47cd..8cfa0b970 100644 --- a/sparrow-py/pysrc/sparrow_py/_session.py +++ b/python/pysrc/kaskada/_session.py @@ -2,7 +2,7 @@ from typing import Optional -from sparrow_py import _ffi +from kaskada import _ffi _SESSION: Optional[_ffi.Session] = None diff --git a/sparrow-py/pysrc/sparrow_py/_timestream.py b/python/pysrc/kaskada/_timestream.py similarity index 97% rename from sparrow-py/pysrc/sparrow_py/_timestream.py rename to python/pysrc/kaskada/_timestream.py index c260d43fd..16cad4fa5 100644 --- a/sparrow-py/pysrc/sparrow_py/_timestream.py +++ b/python/pysrc/kaskada/_timestream.py @@ -14,13 +14,12 @@ from typing import Union from typing import final +import kaskada as kd +import kaskada._ffi as _ffi import pandas as pd import pyarrow as pa from typing_extensions import TypeAlias -import sparrow_py as kt -import sparrow_py._ffi as _ffi - from ._execution import ExecutionOptions from ._result import Result @@ -516,16 +515,16 @@ def index(self, key: Union[Timestream, Literal]) -> Timestream: key : Union[Timestream, Literal] The key to index into the expression. - Returns - ------- - Timestream - Timestream with the resulting value (or `null` if absent) at each point. - Raises ------ TypeError When the Timestream is not a record, list, or map. + Returns + ------- + Timestream + Timestream with the resulting value (or `null` if absent) at each point. + Note ---- Indexing may be written using the operator `self[key]` instead of `self.index(key)`. @@ -539,6 +538,23 @@ def index(self, key: Union[Timestream, Literal]) -> Timestream: raise TypeError(f"Cannot index into {data_type}") def __getitem__(self, key: Union[Timestream, Literal]) -> Timestream: + """ + Index into a list or map Timestrem. + + Parameters + ---------- + key : Union[Timestream, Literal] + The key to index into the expression. + + Returns + ------- + Timestream + Timestream with the resulting value (or `null` if absent) at each point. + + See Also + -------- + index + """ return self.index(key) def col(self, name: str) -> Timestream: @@ -680,7 +696,7 @@ def collect( *, max: Optional[int], min: Optional[int] = 0, - window: Optional[kt.windows.Window] = None, + window: Optional[kd.windows.Window] = None, ) -> Timestream: """ Create a Timestream collecting up to the last `max` values in the `window`. @@ -918,7 +934,7 @@ def shift_until(self, predicate: Timestream) -> Timestream: """ return Timestream._call("shift_until", predicate, self) - def sum(self, *, window: Optional[kt.windows.Window] = None) -> Timestream: + def sum(self, *, window: Optional[kd.windows.Window] = None) -> Timestream: """ Create a Timestream summing the values in the `window`. @@ -937,7 +953,7 @@ def sum(self, *, window: Optional[kt.windows.Window] = None) -> Timestream: """ return _aggregation("sum", self, window) - def first(self, *, window: Optional[kt.windows.Window] = None) -> Timestream: + def first(self, *, window: Optional[kd.windows.Window] = None) -> Timestream: """ Create a Timestream containing the first value in the `window`. @@ -957,7 +973,7 @@ def first(self, *, window: Optional[kt.windows.Window] = None) -> Timestream: """ return _aggregation("first", self, window) - def last(self, window: Optional[kt.windows.Window] = None) -> Timestream: + def last(self, window: Optional[kd.windows.Window] = None) -> Timestream: """ Create a Timestream containing the last value in the `window`. @@ -1029,9 +1045,9 @@ def record(self, fields: Callable[[Timestream], Mapping[str, Arg]]) -> Timestrea Timestream Timestream containing records with the given fields. - See also + See Also -------- - sparrow_py.record: Function for creating a record from one or more + kaskada.record: Function for creating a record from one or more timestreams. """ return record(fields(self)) @@ -1095,7 +1111,7 @@ def run( def _aggregation( op: str, input: Timestream, - window: Optional[kt.windows.Window], + window: Optional[kd.windows.Window], *args: Union[Timestream, Literal], ) -> Timestream: """ @@ -1124,11 +1140,11 @@ def _aggregation( """ if window is None: return Timestream._call(op, input, *args, None, None) - elif isinstance(window, kt.windows.Since): + elif isinstance(window, kd.windows.Since): return Timestream._call(op, input, *args, window.predicate, None) - elif isinstance(window, kt.windows.Sliding): + elif isinstance(window, kd.windows.Sliding): return Timestream._call(op, input, *args, window.predicate, window.duration) - elif isinstance(window, kt.windows.Trailing): + elif isinstance(window, kd.windows.Trailing): if op != "collect": raise NotImplementedError( f"Aggregation '{op} does not support trailing windows" @@ -1154,7 +1170,7 @@ def record(fields: Mapping[str, Arg]) -> Timestream: Timestream Timestream containing records with the given fields. - See also + See Also -------- Timestream.record: Method for creating a record from fields computed from a timestream. diff --git a/sparrow-py/pysrc/sparrow_py/py.typed b/python/pysrc/kaskada/py.typed similarity index 100% rename from sparrow-py/pysrc/sparrow_py/py.typed rename to python/pysrc/kaskada/py.typed diff --git a/sparrow-py/pysrc/sparrow_py/sources/__init__.py b/python/pysrc/kaskada/sources/__init__.py similarity index 100% rename from sparrow-py/pysrc/sparrow_py/sources/__init__.py rename to python/pysrc/kaskada/sources/__init__.py diff --git a/sparrow-py/pysrc/sparrow_py/sources/arrow.py b/python/pysrc/kaskada/sources/arrow.py similarity index 100% rename from sparrow-py/pysrc/sparrow_py/sources/arrow.py rename to python/pysrc/kaskada/sources/arrow.py diff --git a/sparrow-py/pysrc/sparrow_py/sources/source.py b/python/pysrc/kaskada/sources/source.py similarity index 98% rename from sparrow-py/pysrc/sparrow_py/sources/source.py rename to python/pysrc/kaskada/sources/source.py index 220278b18..00bb43c84 100644 --- a/sparrow-py/pysrc/sparrow_py/sources/source.py +++ b/python/pysrc/kaskada/sources/source.py @@ -1,10 +1,9 @@ """Provide the base-class for Kaskada sources.""" from typing import Optional +import kaskada._ffi as _ffi import pyarrow as pa -import sparrow_py._ffi as _ffi - from .._session import _get_session from .._timestream import Timestream diff --git a/sparrow-py/pysrc/sparrow_py/udf.py b/python/pysrc/kaskada/udf.py similarity index 100% rename from sparrow-py/pysrc/sparrow_py/udf.py rename to python/pysrc/kaskada/udf.py diff --git a/sparrow-py/pysrc/sparrow_py/windows.py b/python/pysrc/kaskada/windows.py similarity index 100% rename from sparrow-py/pysrc/sparrow_py/windows.py rename to python/pysrc/kaskada/windows.py diff --git a/sparrow-py/pytests/aggregation_test.py b/python/pytests/aggregation_test.py similarity index 68% rename from sparrow-py/pytests/aggregation_test.py rename to python/pytests/aggregation_test.py index c2a5d817a..8cac84194 100644 --- a/sparrow-py/pytests/aggregation_test.py +++ b/python/pytests/aggregation_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,25 +15,25 @@ def source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_sum_unwindowed(source, golden) -> None: m = source.col("m") n = source.col("n") - golden.jsonl(kt.record({"m": m, "sum_m": m.sum(), "n": n, "sum_n": n.sum()})) + golden.jsonl(kd.record({"m": m, "sum_m": m.sum(), "n": n, "sum_n": n.sum()})) def test_sum_windowed(source, golden) -> None: m = source.col("m") n = source.col("n") golden.jsonl( - kt.record( + kd.record( { "m": m, - "sum_m": m.sum(window=kt.windows.Since(m > 20)), + "sum_m": m.sum(window=kd.windows.Since(m > 20)), "n": n, - "sum_n": n.sum(window=kt.windows.Sliding(2, m > 10)), + "sum_n": n.sum(window=kd.windows.Sliding(2, m > 10)), } ) ) @@ -42,10 +41,10 @@ def test_sum_windowed(source, golden) -> None: def test_sum_since_true(source, golden) -> None: # `since(True)` should be the same as unwindowed, so equals the original vaule. - m_sum_since_true = kt.record( + m_sum_since_true = kd.record( { "m": source.col("m"), - "m_sum": source.col("m").sum(window=kt.windows.Since(True)), + "m_sum": source.col("m").sum(window=kd.windows.Since(True)), } ) golden.jsonl(m_sum_since_true) diff --git a/sparrow-py/pytests/collect_test.py b/python/pytests/collect_test.py similarity index 80% rename from sparrow-py/pytests/collect_test.py rename to python/pytests/collect_test.py index 2c62ebd76..951df4d2c 100644 --- a/sparrow-py/pytests/collect_test.py +++ b/python/pytests/collect_test.py @@ -1,12 +1,11 @@ from datetime import timedelta +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n,s,b", @@ -18,14 +17,14 @@ def source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,,f,true", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_collect_basic(source, golden) -> None: m = source.col("m") n = source.col("n") golden.jsonl( - kt.record( + kd.record( { "m": m, "collect_m": m.collect(max=None), @@ -40,7 +39,7 @@ def test_collect_with_max(source, golden) -> None: m = source.col("m") n = source.col("n") golden.jsonl( - kt.record( + kd.record( { "m": m, "collect_m_max_2": m.collect(max=2), @@ -55,7 +54,7 @@ def test_collect_with_min(source, golden) -> None: m = source.col("m") n = source.col("n") golden.jsonl( - kt.record( + kd.record( { "m": m, "collect_m_min_2": m.collect(min=2, max=None), @@ -70,7 +69,7 @@ def test_collect_with_min_and_max(source, golden) -> None: m = source.col("m") n = source.col("n") golden.jsonl( - kt.record( + kd.record( { "m": m, "collect_m_min_2_max_2": m.collect(min=2, max=2), @@ -84,8 +83,8 @@ def test_collect_with_min_and_max(source, golden) -> None: def test_collect_since_window(source, golden) -> None: m = source.col("m") golden.jsonl( - kt.record( - {"m": m, "since_m": m.collect(max=None, window=kt.windows.Since(m > 10))} + kd.record( + {"m": m, "since_m": m.collect(max=None, window=kd.windows.Since(m > 10))} ) ) @@ -93,11 +92,11 @@ def test_collect_since_window(source, golden) -> None: def test_collect_i64_trailing_window_1s(source, golden) -> None: m = source.col("m") golden.jsonl( - kt.record( + kd.record( { "m": m, "collect_m": m.collect( - max=None, window=kt.windows.Trailing(timedelta(seconds=1)) + max=None, window=kd.windows.Trailing(timedelta(seconds=1)) ), } ) @@ -107,11 +106,11 @@ def test_collect_i64_trailing_window_1s(source, golden) -> None: def test_collect_i64_trailing_window_3s(source, golden) -> None: m = source.col("m") golden.jsonl( - kt.record( + kd.record( { "m": m, "collect_m": m.collect( - max=None, window=kt.windows.Trailing(timedelta(seconds=3)) + max=None, window=kd.windows.Trailing(timedelta(seconds=3)) ), } ) @@ -121,11 +120,11 @@ def test_collect_i64_trailing_window_3s(source, golden) -> None: def test_collect_i64_trailing_window_3s_with_max(source, golden) -> None: m = source.col("m") golden.jsonl( - kt.record( + kd.record( { "m": m, "collect_m": m.collect( - max=2, window=kt.windows.Trailing(timedelta(seconds=3)) + max=2, window=kd.windows.Trailing(timedelta(seconds=3)) ), } ) @@ -135,11 +134,11 @@ def test_collect_i64_trailing_window_3s_with_max(source, golden) -> None: def test_collect_i64_trailing_window_3s_with_min(source, golden) -> None: m = source.col("m") golden.jsonl( - kt.record( + kd.record( { "m": m, "collect_m": m.collect( - min=3, max=None, window=kt.windows.Trailing(timedelta(seconds=3)) + min=3, max=None, window=kd.windows.Trailing(timedelta(seconds=3)) ), } ) @@ -149,11 +148,11 @@ def test_collect_i64_trailing_window_3s_with_min(source, golden) -> None: def test_collect_string_trailing_window_1s(source, golden) -> None: s = source.col("s") golden.jsonl( - kt.record( + kd.record( { "m": s, "collect_s": s.collect( - max=None, window=kt.windows.Trailing(timedelta(seconds=1)) + max=None, window=kd.windows.Trailing(timedelta(seconds=1)) ), } ) @@ -163,11 +162,11 @@ def test_collect_string_trailing_window_1s(source, golden) -> None: def test_collect_string_trailing_window_3s(source, golden) -> None: s = source.col("s") golden.jsonl( - kt.record( + kd.record( { "s": s, "collect_s": s.collect( - max=None, window=kt.windows.Trailing(timedelta(seconds=3)) + max=None, window=kd.windows.Trailing(timedelta(seconds=3)) ), } ) @@ -177,11 +176,11 @@ def test_collect_string_trailing_window_3s(source, golden) -> None: def test_collect_string_trailing_window_3s_with_max(source, golden) -> None: s = source.col("s") golden.jsonl( - kt.record( + kd.record( { "s": s, "collect_s": s.collect( - max=2, window=kt.windows.Trailing(timedelta(seconds=3)) + max=2, window=kd.windows.Trailing(timedelta(seconds=3)) ), } ) @@ -191,11 +190,11 @@ def test_collect_string_trailing_window_3s_with_max(source, golden) -> None: def test_collect_string_trailing_window_3s_with_min(source, golden) -> None: s = source.col("s") golden.jsonl( - kt.record( + kd.record( { "s": s, "collect_s": s.collect( - min=3, max=None, window=kt.windows.Trailing(timedelta(seconds=3)) + min=3, max=None, window=kd.windows.Trailing(timedelta(seconds=3)) ), } ) @@ -205,11 +204,11 @@ def test_collect_string_trailing_window_3s_with_min(source, golden) -> None: def test_collect_bool_trailing_window_1s(source, golden) -> None: b = source.col("b") golden.jsonl( - kt.record( + kd.record( { "b": b, "collect_b": b.collect( - max=None, window=kt.windows.Trailing(timedelta(seconds=1)) + max=None, window=kd.windows.Trailing(timedelta(seconds=1)) ), } ) @@ -219,11 +218,11 @@ def test_collect_bool_trailing_window_1s(source, golden) -> None: def test_collect_bool_trailing_window_3s(source, golden) -> None: b = source.col("b") golden.jsonl( - kt.record( + kd.record( { "b": b, "collect_b": b.collect( - max=None, window=kt.windows.Trailing(timedelta(seconds=3)) + max=None, window=kd.windows.Trailing(timedelta(seconds=3)) ), } ) @@ -233,11 +232,11 @@ def test_collect_bool_trailing_window_3s(source, golden) -> None: def test_collect_bool_trailing_window_3s_with_max(source, golden) -> None: b = source.col("b") golden.jsonl( - kt.record( + kd.record( { "b": b, "collect_b": b.collect( - max=2, window=kt.windows.Trailing(timedelta(seconds=3)) + max=2, window=kd.windows.Trailing(timedelta(seconds=3)) ), } ) @@ -247,11 +246,11 @@ def test_collect_bool_trailing_window_3s_with_max(source, golden) -> None: def test_collect_bool_trailing_window_3s_with_min(source, golden) -> None: b = source.col("b") golden.jsonl( - kt.record( + kd.record( { "b": b, "collect_b": b.collect( - min=3, max=None, window=kt.windows.Trailing(timedelta(seconds=3)) + min=3, max=None, window=kd.windows.Trailing(timedelta(seconds=3)) ), } ) @@ -263,9 +262,9 @@ def test_collect_bool_trailing_window_3s_with_min(source, golden) -> None: # # TODO: Improve the golden testing so this isn't necessary. def test_collect_struct_trailing_window_1s(source, golden) -> None: - collect = source.collect(max=None, window=kt.windows.Trailing(timedelta(seconds=1))) + collect = source.collect(max=None, window=kd.windows.Trailing(timedelta(seconds=1))) golden.jsonl( - kt.record( + kd.record( { "f0": collect[0].col("time"), "f1": collect[1].col("time"), @@ -278,9 +277,9 @@ def test_collect_struct_trailing_window_1s(source, golden) -> None: def test_collect_struct_trailing_window_3s(source, golden) -> None: - collect = source.collect(max=None, window=kt.windows.Trailing(timedelta(seconds=3))) + collect = source.collect(max=None, window=kd.windows.Trailing(timedelta(seconds=3))) golden.jsonl( - kt.record( + kd.record( { "f0": collect[0].col("time"), "f1": collect[1].col("time"), @@ -293,9 +292,9 @@ def test_collect_struct_trailing_window_3s(source, golden) -> None: def test_collect_struct_trailing_window_3s_with_max(source, golden) -> None: - collect = source.collect(max=2, window=kt.windows.Trailing(timedelta(seconds=3))) + collect = source.collect(max=2, window=kd.windows.Trailing(timedelta(seconds=3))) golden.jsonl( - kt.record( + kd.record( { "f0": collect[0].col("time"), "f1": collect[1].col("time"), @@ -309,10 +308,10 @@ def test_collect_struct_trailing_window_3s_with_max(source, golden) -> None: def test_collect_struct_trailing_window_3s_with_min(source, golden) -> None: collect = source.collect( - min=3, max=None, window=kt.windows.Trailing(timedelta(seconds=3)) + min=3, max=None, window=kd.windows.Trailing(timedelta(seconds=3)) ) golden.jsonl( - kt.record( + kd.record( { "f0": collect[0].col("time"), "f1": collect[1].col("time"), @@ -327,19 +326,19 @@ def test_collect_struct_trailing_window_3s_with_min(source, golden) -> None: def test_collect_records(source, golden) -> None: m = source.col("m") n = source.col("n") - golden.jsonl(kt.record({"m": m, "n": n}).collect(max=None)) + golden.jsonl(kd.record({"m": m, "n": n}).collect(max=None)) def test_collect_records_field_ref(source, golden) -> None: m = source.col("m") n = source.col("n") - golden.jsonl(kt.record({"m": m, "n": n}).collect(max=None).col("m")) + golden.jsonl(kd.record({"m": m, "n": n}).collect(max=None).col("m")) def test_collect_lists(source, golden) -> None: m = source.col("m") golden.jsonl( - kt.record( + kd.record( { "m": m, "list_m": m.collect(max=10), diff --git a/sparrow-py/pytests/conftest.py b/python/pytests/conftest.py similarity index 88% rename from sparrow-py/pytests/conftest.py rename to python/pytests/conftest.py index 620407a72..943eb3a36 100644 --- a/sparrow-py/pytests/conftest.py +++ b/python/pytests/conftest.py @@ -1,12 +1,11 @@ import os from typing import Union +import kaskada as kd import pandas as pd import pyarrow as pa import pytest - -import sparrow_py as kt -from sparrow_py import init_session +from kaskada import init_session @pytest.fixture(autouse=True, scope="session") @@ -25,7 +24,7 @@ def __init__(self, dirname: str, test_name: str, save: bool): self._test_name = test_name self._save = save - def jsonl(self, data: Union[kt.Timestream, pd.DataFrame]) -> None: + def jsonl(self, data: Union[kd.Timestream, pd.DataFrame]) -> None: """Golden test against newline-delimited JSON file (json-lines).""" df = _data_to_dataframe(data) filename = self._filename("jsonl") @@ -43,7 +42,7 @@ def jsonl(self, data: Union[kt.Timestream, pd.DataFrame]) -> None: pd.testing.assert_frame_equal(df, golden, check_datetimelike_compat=True) - def parquet(self, data: Union[kt.Timestream, pd.DataFrame]) -> None: + def parquet(self, data: Union[kd.Timestream, pd.DataFrame]) -> None: """Golden test against Parquet file.""" df = _data_to_dataframe(data) filename = self._filename("parquet") @@ -71,19 +70,19 @@ def _filename(self, suffix: str) -> str: return filename -def _data_to_dataframe(data: Union[kt.Timestream, pd.DataFrame]) -> pd.DataFrame: +def _data_to_dataframe(data: Union[kd.Timestream, pd.DataFrame]) -> pd.DataFrame: if isinstance(data, pd.DataFrame): return data - elif isinstance(data, kt.Timestream): + elif isinstance(data, kd.Timestream): return data.run().to_pandas() else: raise ValueError(f"data must be a Timestream or a DataFrame, was {type(data)}") def _data_to_pyarrow( - data: Union[kt.Timestream, pa.RecordBatch, pa.Table] + data: Union[kd.Timestream, pa.RecordBatch, pa.Table] ) -> Union[pa.RecordBatch, pa.Table]: - if isinstance(data, kt.Timestream): + if isinstance(data, kd.Timestream): return data.run().to_pyarrow() elif isinstance(data, pa.RecordBatch) or isinstance(data, pa.Table): return data diff --git a/sparrow-py/pytests/csv_string_source_test.py b/python/pytests/csv_string_source_test.py similarity index 93% rename from sparrow-py/pytests/csv_string_source_test.py rename to python/pytests/csv_string_source_test.py index 8423e5439..777ae1f31 100644 --- a/sparrow-py/pytests/csv_string_source_test.py +++ b/python/pytests/csv_string_source_test.py @@ -1,4 +1,4 @@ -import sparrow_py as kt +import kaskada as kd def test_read_csv(golden) -> None: @@ -24,7 +24,7 @@ def test_read_csv(golden) -> None: "1996-12-19T17:40:02,A,,", ] ) - source = kt.sources.CsvString( + source = kd.sources.CsvString( content1, time_column_name="time", key_column_name="key", diff --git a/sparrow-py/pytests/filter_test.py b/python/pytests/filter_test.py similarity index 85% rename from sparrow-py/pytests/filter_test.py rename to python/pytests/filter_test.py index 428b5c394..30144c779 100644 --- a/sparrow-py/pytests/filter_test.py +++ b/python/pytests/filter_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,7 +15,7 @@ def source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_filter(source, golden) -> None: @@ -25,7 +24,7 @@ def test_filter(source, golden) -> None: condition_m = m > 15 condition_n = n > 5 golden.jsonl( - kt.record( + kd.record( { "m": m, "condition_m": condition_m, diff --git a/sparrow-py/pytests/flatten_test.py b/python/pytests/flatten_test.py similarity index 90% rename from sparrow-py/pytests/flatten_test.py rename to python/pytests/flatten_test.py index 05a17592f..bdf5cc7dd 100644 --- a/sparrow-py/pytests/flatten_test.py +++ b/python/pytests/flatten_test.py @@ -1,8 +1,8 @@ -import sparrow_py as kt +import kaskada as kd def test_flatten(golden) -> None: - source = kt.sources.PyList( + source = kd.sources.PyList( [ {"time": "1996-12-19T16:39:57", "user": "A", "m": [[5]]}, {"time": "1996-12-19T17:39:57", "user": "A", "m": []}, diff --git a/sparrow-py/pytests/golden/aggregation_test/test_sum_since_true.jsonl b/python/pytests/golden/aggregation_test/test_sum_since_true.jsonl similarity index 100% rename from sparrow-py/pytests/golden/aggregation_test/test_sum_since_true.jsonl rename to python/pytests/golden/aggregation_test/test_sum_since_true.jsonl diff --git a/sparrow-py/pytests/golden/aggregation_test/test_sum_unwindowed.jsonl b/python/pytests/golden/aggregation_test/test_sum_unwindowed.jsonl similarity index 100% rename from sparrow-py/pytests/golden/aggregation_test/test_sum_unwindowed.jsonl rename to python/pytests/golden/aggregation_test/test_sum_unwindowed.jsonl diff --git a/sparrow-py/pytests/golden/aggregation_test/test_sum_windowed.jsonl b/python/pytests/golden/aggregation_test/test_sum_windowed.jsonl similarity index 100% rename from sparrow-py/pytests/golden/aggregation_test/test_sum_windowed.jsonl rename to python/pytests/golden/aggregation_test/test_sum_windowed.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_basic.jsonl b/python/pytests/golden/collect_test/test_collect_basic.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_basic.jsonl rename to python/pytests/golden/collect_test/test_collect_basic.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_bool_trailing_window_1s.jsonl b/python/pytests/golden/collect_test/test_collect_bool_trailing_window_1s.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_bool_trailing_window_1s.jsonl rename to python/pytests/golden/collect_test/test_collect_bool_trailing_window_1s.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_bool_trailing_window_3s.jsonl b/python/pytests/golden/collect_test/test_collect_bool_trailing_window_3s.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_bool_trailing_window_3s.jsonl rename to python/pytests/golden/collect_test/test_collect_bool_trailing_window_3s.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_bool_trailing_window_3s_with_max.jsonl b/python/pytests/golden/collect_test/test_collect_bool_trailing_window_3s_with_max.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_bool_trailing_window_3s_with_max.jsonl rename to python/pytests/golden/collect_test/test_collect_bool_trailing_window_3s_with_max.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_bool_trailing_window_3s_with_min.jsonl b/python/pytests/golden/collect_test/test_collect_bool_trailing_window_3s_with_min.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_bool_trailing_window_3s_with_min.jsonl rename to python/pytests/golden/collect_test/test_collect_bool_trailing_window_3s_with_min.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_i64_trailing_window_1s.jsonl b/python/pytests/golden/collect_test/test_collect_i64_trailing_window_1s.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_i64_trailing_window_1s.jsonl rename to python/pytests/golden/collect_test/test_collect_i64_trailing_window_1s.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_i64_trailing_window_3s.jsonl b/python/pytests/golden/collect_test/test_collect_i64_trailing_window_3s.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_i64_trailing_window_3s.jsonl rename to python/pytests/golden/collect_test/test_collect_i64_trailing_window_3s.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_i64_trailing_window_3s_with_max.jsonl b/python/pytests/golden/collect_test/test_collect_i64_trailing_window_3s_with_max.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_i64_trailing_window_3s_with_max.jsonl rename to python/pytests/golden/collect_test/test_collect_i64_trailing_window_3s_with_max.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_i64_trailing_window_3s_with_min.jsonl b/python/pytests/golden/collect_test/test_collect_i64_trailing_window_3s_with_min.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_i64_trailing_window_3s_with_min.jsonl rename to python/pytests/golden/collect_test/test_collect_i64_trailing_window_3s_with_min.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_lists.jsonl b/python/pytests/golden/collect_test/test_collect_lists.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_lists.jsonl rename to python/pytests/golden/collect_test/test_collect_lists.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_records.jsonl b/python/pytests/golden/collect_test/test_collect_records.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_records.jsonl rename to python/pytests/golden/collect_test/test_collect_records.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_records_field_ref.jsonl b/python/pytests/golden/collect_test/test_collect_records_field_ref.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_records_field_ref.jsonl rename to python/pytests/golden/collect_test/test_collect_records_field_ref.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_since_window.jsonl b/python/pytests/golden/collect_test/test_collect_since_window.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_since_window.jsonl rename to python/pytests/golden/collect_test/test_collect_since_window.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_string_trailing_window_1s.jsonl b/python/pytests/golden/collect_test/test_collect_string_trailing_window_1s.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_string_trailing_window_1s.jsonl rename to python/pytests/golden/collect_test/test_collect_string_trailing_window_1s.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_string_trailing_window_3s.jsonl b/python/pytests/golden/collect_test/test_collect_string_trailing_window_3s.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_string_trailing_window_3s.jsonl rename to python/pytests/golden/collect_test/test_collect_string_trailing_window_3s.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_string_trailing_window_3s_with_max.jsonl b/python/pytests/golden/collect_test/test_collect_string_trailing_window_3s_with_max.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_string_trailing_window_3s_with_max.jsonl rename to python/pytests/golden/collect_test/test_collect_string_trailing_window_3s_with_max.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_string_trailing_window_3s_with_min.jsonl b/python/pytests/golden/collect_test/test_collect_string_trailing_window_3s_with_min.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_string_trailing_window_3s_with_min.jsonl rename to python/pytests/golden/collect_test/test_collect_string_trailing_window_3s_with_min.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_struct_trailing_window_1s.jsonl b/python/pytests/golden/collect_test/test_collect_struct_trailing_window_1s.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_struct_trailing_window_1s.jsonl rename to python/pytests/golden/collect_test/test_collect_struct_trailing_window_1s.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_struct_trailing_window_3s.jsonl b/python/pytests/golden/collect_test/test_collect_struct_trailing_window_3s.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_struct_trailing_window_3s.jsonl rename to python/pytests/golden/collect_test/test_collect_struct_trailing_window_3s.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_struct_trailing_window_3s_with_max.jsonl b/python/pytests/golden/collect_test/test_collect_struct_trailing_window_3s_with_max.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_struct_trailing_window_3s_with_max.jsonl rename to python/pytests/golden/collect_test/test_collect_struct_trailing_window_3s_with_max.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_struct_trailing_window_3s_with_min.jsonl b/python/pytests/golden/collect_test/test_collect_struct_trailing_window_3s_with_min.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_struct_trailing_window_3s_with_min.jsonl rename to python/pytests/golden/collect_test/test_collect_struct_trailing_window_3s_with_min.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_with_max.jsonl b/python/pytests/golden/collect_test/test_collect_with_max.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_with_max.jsonl rename to python/pytests/golden/collect_test/test_collect_with_max.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_with_min.jsonl b/python/pytests/golden/collect_test/test_collect_with_min.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_with_min.jsonl rename to python/pytests/golden/collect_test/test_collect_with_min.jsonl diff --git a/sparrow-py/pytests/golden/collect_test/test_collect_with_min_and_max.jsonl b/python/pytests/golden/collect_test/test_collect_with_min_and_max.jsonl similarity index 100% rename from sparrow-py/pytests/golden/collect_test/test_collect_with_min_and_max.jsonl rename to python/pytests/golden/collect_test/test_collect_with_min_and_max.jsonl diff --git a/sparrow-py/pytests/golden/csv_string_source_test/test_read_csv.jsonl b/python/pytests/golden/csv_string_source_test/test_read_csv.jsonl similarity index 100% rename from sparrow-py/pytests/golden/csv_string_source_test/test_read_csv.jsonl rename to python/pytests/golden/csv_string_source_test/test_read_csv.jsonl diff --git a/sparrow-py/pytests/golden/csv_string_source_test/test_read_csv_1.jsonl b/python/pytests/golden/csv_string_source_test/test_read_csv_1.jsonl similarity index 100% rename from sparrow-py/pytests/golden/csv_string_source_test/test_read_csv_1.jsonl rename to python/pytests/golden/csv_string_source_test/test_read_csv_1.jsonl diff --git a/sparrow-py/pytests/golden/filter_test/test_filter.jsonl b/python/pytests/golden/filter_test/test_filter.jsonl similarity index 100% rename from sparrow-py/pytests/golden/filter_test/test_filter.jsonl rename to python/pytests/golden/filter_test/test_filter.jsonl diff --git a/sparrow-py/pytests/golden/flatten_test/test_flatten.jsonl b/python/pytests/golden/flatten_test/test_flatten.jsonl similarity index 100% rename from sparrow-py/pytests/golden/flatten_test/test_flatten.jsonl rename to python/pytests/golden/flatten_test/test_flatten.jsonl diff --git a/sparrow-py/pytests/golden/if_test/test_if_.jsonl b/python/pytests/golden/if_test/test_if_.jsonl similarity index 100% rename from sparrow-py/pytests/golden/if_test/test_if_.jsonl rename to python/pytests/golden/if_test/test_if_.jsonl diff --git a/sparrow-py/pytests/golden/jsonl_string_source_test/test_read_jsonl.jsonl b/python/pytests/golden/jsonl_string_source_test/test_read_jsonl.jsonl similarity index 100% rename from sparrow-py/pytests/golden/jsonl_string_source_test/test_read_jsonl.jsonl rename to python/pytests/golden/jsonl_string_source_test/test_read_jsonl.jsonl diff --git a/sparrow-py/pytests/golden/jsonl_string_source_test/test_read_jsonl_1.jsonl b/python/pytests/golden/jsonl_string_source_test/test_read_jsonl_1.jsonl similarity index 100% rename from sparrow-py/pytests/golden/jsonl_string_source_test/test_read_jsonl_1.jsonl rename to python/pytests/golden/jsonl_string_source_test/test_read_jsonl_1.jsonl diff --git a/sparrow-py/pytests/golden/jsonl_string_source_test/test_read_jsonl_lists.jsonl b/python/pytests/golden/jsonl_string_source_test/test_read_jsonl_lists.jsonl similarity index 100% rename from sparrow-py/pytests/golden/jsonl_string_source_test/test_read_jsonl_lists.jsonl rename to python/pytests/golden/jsonl_string_source_test/test_read_jsonl_lists.jsonl diff --git a/sparrow-py/pytests/golden/jsonl_string_source_test/test_read_jsonl_lists_1.jsonl b/python/pytests/golden/jsonl_string_source_test/test_read_jsonl_lists_1.jsonl similarity index 100% rename from sparrow-py/pytests/golden/jsonl_string_source_test/test_read_jsonl_lists_1.jsonl rename to python/pytests/golden/jsonl_string_source_test/test_read_jsonl_lists_1.jsonl diff --git a/sparrow-py/pytests/golden/lag_test/test_lag.jsonl b/python/pytests/golden/lag_test/test_lag.jsonl similarity index 100% rename from sparrow-py/pytests/golden/lag_test/test_lag.jsonl rename to python/pytests/golden/lag_test/test_lag.jsonl diff --git a/sparrow-py/pytests/golden/lag_test/test_lag_list.jsonl b/python/pytests/golden/lag_test/test_lag_list.jsonl similarity index 100% rename from sparrow-py/pytests/golden/lag_test/test_lag_list.jsonl rename to python/pytests/golden/lag_test/test_lag_list.jsonl diff --git a/sparrow-py/pytests/golden/lag_test/test_lag_struct.jsonl b/python/pytests/golden/lag_test/test_lag_struct.jsonl similarity index 100% rename from sparrow-py/pytests/golden/lag_test/test_lag_struct.jsonl rename to python/pytests/golden/lag_test/test_lag_struct.jsonl diff --git a/sparrow-py/pytests/golden/length_test/test_length.jsonl b/python/pytests/golden/length_test/test_length.jsonl similarity index 100% rename from sparrow-py/pytests/golden/length_test/test_length.jsonl rename to python/pytests/golden/length_test/test_length.jsonl diff --git a/sparrow-py/pytests/golden/lookup_test/test_lookup.jsonl b/python/pytests/golden/lookup_test/test_lookup.jsonl similarity index 100% rename from sparrow-py/pytests/golden/lookup_test/test_lookup.jsonl rename to python/pytests/golden/lookup_test/test_lookup.jsonl diff --git a/sparrow-py/pytests/golden/math_test/test_math_int64.jsonl b/python/pytests/golden/math_test/test_math_int64.jsonl similarity index 100% rename from sparrow-py/pytests/golden/math_test/test_math_int64.jsonl rename to python/pytests/golden/math_test/test_math_int64.jsonl diff --git a/sparrow-py/pytests/golden/null_if_test/test_null_if.jsonl b/python/pytests/golden/null_if_test/test_null_if.jsonl similarity index 100% rename from sparrow-py/pytests/golden/null_if_test/test_null_if.jsonl rename to python/pytests/golden/null_if_test/test_null_if.jsonl diff --git a/sparrow-py/pytests/golden/pandas_source_test/test_add_dataframe.jsonl b/python/pytests/golden/pandas_source_test/test_add_dataframe.jsonl similarity index 100% rename from sparrow-py/pytests/golden/pandas_source_test/test_add_dataframe.jsonl rename to python/pytests/golden/pandas_source_test/test_add_dataframe.jsonl diff --git a/sparrow-py/pytests/golden/pandas_source_test/test_add_dataframe_1.jsonl b/python/pytests/golden/pandas_source_test/test_add_dataframe_1.jsonl similarity index 100% rename from sparrow-py/pytests/golden/pandas_source_test/test_add_dataframe_1.jsonl rename to python/pytests/golden/pandas_source_test/test_add_dataframe_1.jsonl diff --git a/sparrow-py/pytests/golden/parquet_source_test/test_read_parquet.jsonl b/python/pytests/golden/parquet_source_test/test_read_parquet.jsonl similarity index 100% rename from sparrow-py/pytests/golden/parquet_source_test/test_read_parquet.jsonl rename to python/pytests/golden/parquet_source_test/test_read_parquet.jsonl diff --git a/sparrow-py/pytests/golden/parquet_source_test/test_read_parquet_1.jsonl b/python/pytests/golden/parquet_source_test/test_read_parquet_1.jsonl similarity index 100% rename from sparrow-py/pytests/golden/parquet_source_test/test_read_parquet_1.jsonl rename to python/pytests/golden/parquet_source_test/test_read_parquet_1.jsonl diff --git a/sparrow-py/pytests/golden/pylist_source_test/test_read_pylist.jsonl b/python/pytests/golden/pylist_source_test/test_read_pylist.jsonl similarity index 100% rename from sparrow-py/pytests/golden/pylist_source_test/test_read_pylist.jsonl rename to python/pytests/golden/pylist_source_test/test_read_pylist.jsonl diff --git a/sparrow-py/pytests/golden/pylist_source_test/test_read_pylist_1.jsonl b/python/pytests/golden/pylist_source_test/test_read_pylist_1.jsonl similarity index 100% rename from sparrow-py/pytests/golden/pylist_source_test/test_read_pylist_1.jsonl rename to python/pytests/golden/pylist_source_test/test_read_pylist_1.jsonl diff --git a/sparrow-py/pytests/golden/pylist_source_test/test_read_pylist_2.jsonl b/python/pytests/golden/pylist_source_test/test_read_pylist_2.jsonl similarity index 100% rename from sparrow-py/pytests/golden/pylist_source_test/test_read_pylist_2.jsonl rename to python/pytests/golden/pylist_source_test/test_read_pylist_2.jsonl diff --git a/sparrow-py/pytests/golden/pylist_source_test/test_read_pylist_lists.jsonl b/python/pytests/golden/pylist_source_test/test_read_pylist_lists.jsonl similarity index 100% rename from sparrow-py/pytests/golden/pylist_source_test/test_read_pylist_lists.jsonl rename to python/pytests/golden/pylist_source_test/test_read_pylist_lists.jsonl diff --git a/sparrow-py/pytests/golden/pylist_source_test/test_read_pylist_lists_1.jsonl b/python/pytests/golden/pylist_source_test/test_read_pylist_lists_1.jsonl similarity index 100% rename from sparrow-py/pytests/golden/pylist_source_test/test_read_pylist_lists_1.jsonl rename to python/pytests/golden/pylist_source_test/test_read_pylist_lists_1.jsonl diff --git a/sparrow-py/pytests/golden/record_test/test_extend_input.jsonl b/python/pytests/golden/record_test/test_extend_input.jsonl similarity index 100% rename from sparrow-py/pytests/golden/record_test/test_extend_input.jsonl rename to python/pytests/golden/record_test/test_extend_input.jsonl diff --git a/sparrow-py/pytests/golden/record_test/test_extend_record.jsonl b/python/pytests/golden/record_test/test_extend_record.jsonl similarity index 100% rename from sparrow-py/pytests/golden/record_test/test_extend_record.jsonl rename to python/pytests/golden/record_test/test_extend_record.jsonl diff --git a/sparrow-py/pytests/golden/record_test/test_record.jsonl b/python/pytests/golden/record_test/test_record.jsonl similarity index 100% rename from sparrow-py/pytests/golden/record_test/test_record.jsonl rename to python/pytests/golden/record_test/test_record.jsonl diff --git a/sparrow-py/pytests/golden/record_test/test_remove_record.jsonl b/python/pytests/golden/record_test/test_remove_record.jsonl similarity index 100% rename from sparrow-py/pytests/golden/record_test/test_remove_record.jsonl rename to python/pytests/golden/record_test/test_remove_record.jsonl diff --git a/sparrow-py/pytests/golden/record_test/test_select_record.jsonl b/python/pytests/golden/record_test/test_select_record.jsonl similarity index 100% rename from sparrow-py/pytests/golden/record_test/test_select_record.jsonl rename to python/pytests/golden/record_test/test_select_record.jsonl diff --git a/sparrow-py/pytests/golden/result_test/test_iter_pandas.jsonl b/python/pytests/golden/result_test/test_iter_pandas.jsonl similarity index 100% rename from sparrow-py/pytests/golden/result_test/test_iter_pandas.jsonl rename to python/pytests/golden/result_test/test_iter_pandas.jsonl diff --git a/sparrow-py/pytests/golden/result_test/test_iter_pandas_1.jsonl b/python/pytests/golden/result_test/test_iter_pandas_1.jsonl similarity index 100% rename from sparrow-py/pytests/golden/result_test/test_iter_pandas_1.jsonl rename to python/pytests/golden/result_test/test_iter_pandas_1.jsonl diff --git a/sparrow-py/pytests/golden/result_test/test_iter_pandas_async.jsonl b/python/pytests/golden/result_test/test_iter_pandas_async.jsonl similarity index 100% rename from sparrow-py/pytests/golden/result_test/test_iter_pandas_async.jsonl rename to python/pytests/golden/result_test/test_iter_pandas_async.jsonl diff --git a/sparrow-py/pytests/golden/result_test/test_iter_pandas_async_1.jsonl b/python/pytests/golden/result_test/test_iter_pandas_async_1.jsonl similarity index 100% rename from sparrow-py/pytests/golden/result_test/test_iter_pandas_async_1.jsonl rename to python/pytests/golden/result_test/test_iter_pandas_async_1.jsonl diff --git a/sparrow-py/pytests/golden/result_test/test_iter_pandas_async_materialize.jsonl b/python/pytests/golden/result_test/test_iter_pandas_async_materialize.jsonl similarity index 100% rename from sparrow-py/pytests/golden/result_test/test_iter_pandas_async_materialize.jsonl rename to python/pytests/golden/result_test/test_iter_pandas_async_materialize.jsonl diff --git a/sparrow-py/pytests/golden/result_test/test_iter_pandas_async_materialize_1.jsonl b/python/pytests/golden/result_test/test_iter_pandas_async_materialize_1.jsonl similarity index 100% rename from sparrow-py/pytests/golden/result_test/test_iter_pandas_async_materialize_1.jsonl rename to python/pytests/golden/result_test/test_iter_pandas_async_materialize_1.jsonl diff --git a/sparrow-py/pytests/golden/shift_by_test/test_shift_by_timedelta.jsonl b/python/pytests/golden/shift_by_test/test_shift_by_timedelta.jsonl similarity index 100% rename from sparrow-py/pytests/golden/shift_by_test/test_shift_by_timedelta.jsonl rename to python/pytests/golden/shift_by_test/test_shift_by_timedelta.jsonl diff --git a/sparrow-py/pytests/golden/shift_by_test/test_shift_collect.jsonl b/python/pytests/golden/shift_by_test/test_shift_collect.jsonl similarity index 100% rename from sparrow-py/pytests/golden/shift_by_test/test_shift_collect.jsonl rename to python/pytests/golden/shift_by_test/test_shift_collect.jsonl diff --git a/sparrow-py/pytests/golden/shift_to_test/test_shift_to_column.jsonl b/python/pytests/golden/shift_to_test/test_shift_to_column.jsonl similarity index 100% rename from sparrow-py/pytests/golden/shift_to_test/test_shift_to_column.jsonl rename to python/pytests/golden/shift_to_test/test_shift_to_column.jsonl diff --git a/sparrow-py/pytests/golden/shift_until_test/test_shift_until_predicate.jsonl b/python/pytests/golden/shift_until_test/test_shift_until_predicate.jsonl similarity index 100% rename from sparrow-py/pytests/golden/shift_until_test/test_shift_until_predicate.jsonl rename to python/pytests/golden/shift_until_test/test_shift_until_predicate.jsonl diff --git a/sparrow-py/pytests/golden/time_of_test/test_time_of.jsonl b/python/pytests/golden/time_of_test/test_time_of.jsonl similarity index 100% rename from sparrow-py/pytests/golden/time_of_test/test_time_of.jsonl rename to python/pytests/golden/time_of_test/test_time_of.jsonl diff --git a/sparrow-py/pytests/golden/time_test/test_time_add_days.jsonl b/python/pytests/golden/time_test/test_time_add_days.jsonl similarity index 100% rename from sparrow-py/pytests/golden/time_test/test_time_add_days.jsonl rename to python/pytests/golden/time_test/test_time_add_days.jsonl diff --git a/sparrow-py/pytests/golden/time_test/test_time_add_days_and_minutes.jsonl b/python/pytests/golden/time_test/test_time_add_days_and_minutes.jsonl similarity index 100% rename from sparrow-py/pytests/golden/time_test/test_time_add_days_and_minutes.jsonl rename to python/pytests/golden/time_test/test_time_add_days_and_minutes.jsonl diff --git a/sparrow-py/pytests/golden/time_test/test_time_add_hours.jsonl b/python/pytests/golden/time_test/test_time_add_hours.jsonl similarity index 100% rename from sparrow-py/pytests/golden/time_test/test_time_add_hours.jsonl rename to python/pytests/golden/time_test/test_time_add_hours.jsonl diff --git a/sparrow-py/pytests/golden/time_test/test_time_add_minutes.jsonl b/python/pytests/golden/time_test/test_time_add_minutes.jsonl similarity index 100% rename from sparrow-py/pytests/golden/time_test/test_time_add_minutes.jsonl rename to python/pytests/golden/time_test/test_time_add_minutes.jsonl diff --git a/sparrow-py/pytests/golden/time_test/test_time_add_seconds.jsonl b/python/pytests/golden/time_test/test_time_add_seconds.jsonl similarity index 100% rename from sparrow-py/pytests/golden/time_test/test_time_add_seconds.jsonl rename to python/pytests/golden/time_test/test_time_add_seconds.jsonl diff --git a/sparrow-py/pytests/golden/timestream_test/test_timestream_cast.jsonl b/python/pytests/golden/timestream_test/test_timestream_cast.jsonl similarity index 100% rename from sparrow-py/pytests/golden/timestream_test/test_timestream_cast.jsonl rename to python/pytests/golden/timestream_test/test_timestream_cast.jsonl diff --git a/sparrow-py/pytests/golden/timestream_test/test_timestream_preview.jsonl b/python/pytests/golden/timestream_test/test_timestream_preview.jsonl similarity index 100% rename from sparrow-py/pytests/golden/timestream_test/test_timestream_preview.jsonl rename to python/pytests/golden/timestream_test/test_timestream_preview.jsonl diff --git a/sparrow-py/pytests/golden/timestream_test/test_timestream_run_non_record.jsonl b/python/pytests/golden/timestream_test/test_timestream_run_non_record.jsonl similarity index 100% rename from sparrow-py/pytests/golden/timestream_test/test_timestream_run_non_record.jsonl rename to python/pytests/golden/timestream_test/test_timestream_run_non_record.jsonl diff --git a/sparrow-py/pytests/golden/union_test/test_union.jsonl b/python/pytests/golden/union_test/test_union.jsonl similarity index 100% rename from sparrow-py/pytests/golden/union_test/test_union.jsonl rename to python/pytests/golden/union_test/test_union.jsonl diff --git a/sparrow-py/pytests/golden/with_key_test/test_with_key_column.jsonl b/python/pytests/golden/with_key_test/test_with_key_column.jsonl similarity index 100% rename from sparrow-py/pytests/golden/with_key_test/test_with_key_column.jsonl rename to python/pytests/golden/with_key_test/test_with_key_column.jsonl diff --git a/sparrow-py/pytests/golden/with_key_test/test_with_key_grouping.jsonl b/python/pytests/golden/with_key_test/test_with_key_grouping.jsonl similarity index 100% rename from sparrow-py/pytests/golden/with_key_test/test_with_key_grouping.jsonl rename to python/pytests/golden/with_key_test/test_with_key_grouping.jsonl diff --git a/sparrow-py/pytests/golden/with_key_test/test_with_key_last.jsonl b/python/pytests/golden/with_key_test/test_with_key_last.jsonl similarity index 100% rename from sparrow-py/pytests/golden/with_key_test/test_with_key_last.jsonl rename to python/pytests/golden/with_key_test/test_with_key_last.jsonl diff --git a/sparrow-py/pytests/golden/with_key_test/test_with_key_literal.jsonl b/python/pytests/golden/with_key_test/test_with_key_literal.jsonl similarity index 100% rename from sparrow-py/pytests/golden/with_key_test/test_with_key_literal.jsonl rename to python/pytests/golden/with_key_test/test_with_key_literal.jsonl diff --git a/sparrow-py/pytests/if_test.py b/python/pytests/if_test.py similarity index 84% rename from sparrow-py/pytests/if_test.py rename to python/pytests/if_test.py index cb8fafb4b..d30e90eab 100644 --- a/sparrow-py/pytests/if_test.py +++ b/python/pytests/if_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,7 +15,7 @@ def source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_if_(source, golden) -> None: @@ -25,7 +24,7 @@ def test_if_(source, golden) -> None: condition_m = m > 15 condition_n = n > 5 golden.jsonl( - kt.record( + kd.record( { "m": m, "condition_m": condition_m, diff --git a/sparrow-py/pytests/jsonl_string_source_test.py b/python/pytests/jsonl_string_source_test.py similarity index 89% rename from sparrow-py/pytests/jsonl_string_source_test.py rename to python/pytests/jsonl_string_source_test.py index b649c1a2c..b7191a48a 100644 --- a/sparrow-py/pytests/jsonl_string_source_test.py +++ b/python/pytests/jsonl_string_source_test.py @@ -1,8 +1,8 @@ -import sparrow_py as kt +import kaskada as kd def test_read_jsonl(golden) -> None: - source = kt.sources.JsonlString( + source = kd.sources.JsonlString( '{"time": "1996-12-19T16:39:57", "user": "A", "m": 5, "n": 10}', time_column_name="time", key_column_name="user", @@ -20,7 +20,7 @@ def test_read_jsonl(golden) -> None: def test_read_jsonl_lists(golden) -> None: - source = kt.sources.JsonlString( + source = kd.sources.JsonlString( '{"time": "1996-12-19T16:39:57", "user": "A", "m": [5, 10], "n": 10}', time_column_name="time", key_column_name="user", diff --git a/sparrow-py/pytests/lag_test.py b/python/pytests/lag_test.py similarity index 86% rename from sparrow-py/pytests/lag_test.py rename to python/pytests/lag_test.py index c288b9ec9..5fe59c88d 100644 --- a/sparrow-py/pytests/lag_test.py +++ b/python/pytests/lag_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,14 +15,14 @@ def source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_lag(source, golden) -> None: m = source.col("m") n = source.col("n") golden.jsonl( - kt.record( + kd.record( { "m": m, "lag_1_m": m.lag(1), @@ -43,7 +42,7 @@ def test_lag_struct(source, golden) -> None: def test_lag_list(source, golden) -> None: m = source.col("m") golden.jsonl( - kt.record( + kd.record( { "m": m, "list_m": m.collect(max=None), diff --git a/sparrow-py/pytests/length_test.py b/python/pytests/length_test.py similarity index 83% rename from sparrow-py/pytests/length_test.py rename to python/pytests/length_test.py index 3ccc7cd44..eeac4d92c 100644 --- a/sparrow-py/pytests/length_test.py +++ b/python/pytests/length_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n,str", @@ -16,14 +15,14 @@ def source() -> kt.sources.CsvString: '1996-12-19T16:40:02,A,,,"fig"', ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_length(source, golden) -> None: my_str = source.col("str") list = my_str.collect(max=None) golden.jsonl( - kt.record( + kd.record( { "str": my_str, "len_key": my_str.length(), diff --git a/sparrow-py/pytests/lookup_test.py b/python/pytests/lookup_test.py similarity index 82% rename from sparrow-py/pytests/lookup_test.py rename to python/pytests/lookup_test.py index 880fe1c24..c94b62002 100644 --- a/sparrow-py/pytests/lookup_test.py +++ b/python/pytests/lookup_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def key_source() -> kt.sources.CsvString: +def key_source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,state", @@ -16,11 +15,11 @@ def key_source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,WA", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") @pytest.fixture(scope="module") -def foreign_source() -> kt.sources.CsvString: +def foreign_source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -32,7 +31,7 @@ def foreign_source() -> kt.sources.CsvString: "1996-12-19T16:40:02,WA,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_lookup(key_source, foreign_source, golden) -> None: @@ -40,7 +39,7 @@ def test_lookup(key_source, foreign_source, golden) -> None: foreign_value = foreign_source.col("m") last_foreign_value = foreign_source.col("m").last() golden.jsonl( - kt.record( + kd.record( { "state": state, "lookup": foreign_value.lookup(state), diff --git a/sparrow-py/pytests/math_test.py b/python/pytests/math_test.py similarity index 81% rename from sparrow-py/pytests/math_test.py rename to python/pytests/math_test.py index bd13054be..d44c8dee6 100644 --- a/sparrow-py/pytests/math_test.py +++ b/python/pytests/math_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture -def source_int64() -> kt.sources.CsvString: +def source_int64() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,14 +15,14 @@ def source_int64() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_math_int64(golden, source_int64) -> None: m = source_int64.col("m") n = source_int64.col("n") golden.jsonl( - kt.record( + kd.record( { "m": m, "n": n, diff --git a/sparrow-py/pytests/null_if_test.py b/python/pytests/null_if_test.py similarity index 85% rename from sparrow-py/pytests/null_if_test.py rename to python/pytests/null_if_test.py index e8aae26d0..ebed2eb69 100644 --- a/sparrow-py/pytests/null_if_test.py +++ b/python/pytests/null_if_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,7 +15,7 @@ def source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_null_if(source, golden) -> None: @@ -25,7 +24,7 @@ def test_null_if(source, golden) -> None: condition_m = m > 15 condition_n = n > 5 golden.jsonl( - kt.record( + kd.record( { "m": m, "condition_m": condition_m, diff --git a/sparrow-py/pytests/pandas_source_test.py b/python/pytests/pandas_source_test.py similarity index 91% rename from sparrow-py/pytests/pandas_source_test.py rename to python/pytests/pandas_source_test.py index 5624a199f..2d9f25c88 100644 --- a/sparrow-py/pytests/pandas_source_test.py +++ b/python/pytests/pandas_source_test.py @@ -1,9 +1,8 @@ import random +import kaskada as kd import pandas as pd -import sparrow_py as kt - def test_add_dataframe(golden) -> None: random.seed(1000) @@ -20,7 +19,7 @@ def test_add_dataframe(golden) -> None: ) dataset1 = pd.DataFrame(records) - table = kt.sources.Pandas(dataset1, time_column_name="time", key_column_name="key") + table = kd.sources.Pandas(dataset1, time_column_name="time", key_column_name="key") golden.jsonl(table) records.clear() diff --git a/sparrow-py/pytests/parquet_source_test.py b/python/pytests/parquet_source_test.py similarity index 84% rename from sparrow-py/pytests/parquet_source_test.py rename to python/pytests/parquet_source_test.py index 9c08c2b21..6df717202 100644 --- a/sparrow-py/pytests/parquet_source_test.py +++ b/python/pytests/parquet_source_test.py @@ -1,8 +1,8 @@ -import sparrow_py as kt +import kaskada as kd def test_read_parquet(golden) -> None: - source = kt.sources.Parquet( + source = kd.sources.Parquet( "../testdata/purchases/purchases_part1.parquet", time_column_name="purchase_time", key_column_name="customer_id", diff --git a/sparrow-py/pytests/pylist_source_test.py b/python/pytests/pylist_source_test.py similarity index 91% rename from sparrow-py/pytests/pylist_source_test.py rename to python/pytests/pylist_source_test.py index bede6774e..942e8dbdd 100644 --- a/sparrow-py/pytests/pylist_source_test.py +++ b/python/pytests/pylist_source_test.py @@ -1,8 +1,8 @@ -import sparrow_py as kt +import kaskada as kd def test_read_pylist(golden) -> None: - source = kt.sources.PyList( + source = kd.sources.PyList( [{"time": "1996-12-19T16:39:57", "user": "A", "m": 5, "n": 10}], time_column_name="time", key_column_name="user", @@ -22,7 +22,7 @@ def test_read_pylist(golden) -> None: def test_read_pylist_lists(golden) -> None: - source = kt.sources.PyList( + source = kd.sources.PyList( [{"time": "1996-12-19T16:39:57", "user": "A", "m": [5, 10], "n": 10}], time_column_name="time", key_column_name="user", diff --git a/sparrow-py/pytests/record_test.py b/python/pytests/record_test.py similarity index 87% rename from sparrow-py/pytests/record_test.py rename to python/pytests/record_test.py index f656f3a2a..c55698517 100644 --- a/sparrow-py/pytests/record_test.py +++ b/python/pytests/record_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,7 +15,7 @@ def source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_record(source, golden) -> None: @@ -24,7 +23,7 @@ def test_record(source, golden) -> None: n = source.col("n") golden.jsonl( - kt.record( + kd.record( { "m": m, "n": n, diff --git a/sparrow-py/pytests/result_test.py b/python/pytests/result_test.py similarity index 94% rename from sparrow-py/pytests/result_test.py rename to python/pytests/result_test.py index d864325e9..dee608d36 100644 --- a/sparrow-py/pytests/result_test.py +++ b/python/pytests/result_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture -def source_int64() -> kt.sources.CsvString: +def source_int64() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,7 +15,7 @@ def source_int64() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_iter_pandas(golden, source_int64) -> None: diff --git a/sparrow-py/pytests/shift_by_test.py b/python/pytests/shift_by_test.py similarity index 91% rename from sparrow-py/pytests/shift_by_test.py rename to python/pytests/shift_by_test.py index a4800ce95..7d838105d 100644 --- a/sparrow-py/pytests/shift_by_test.py +++ b/python/pytests/shift_by_test.py @@ -1,12 +1,11 @@ from datetime import timedelta +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,13 +15,13 @@ def source() -> kt.sources.CsvString: "1997-01-18T16:40:00,A,,9", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_shift_by_timedelta(source, golden) -> None: time = source.col("time") golden.jsonl( - kt.record( + kd.record( { "time": time, "shift_by_1_s": time.shift_by(timedelta(seconds=1)), diff --git a/sparrow-py/pytests/shift_to_test.py b/python/pytests/shift_to_test.py similarity index 85% rename from sparrow-py/pytests/shift_to_test.py rename to python/pytests/shift_to_test.py index d05905904..3be361c59 100644 --- a/sparrow-py/pytests/shift_to_test.py +++ b/python/pytests/shift_to_test.py @@ -1,13 +1,12 @@ from datetime import datetime from datetime import timedelta +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -17,7 +16,7 @@ def source() -> kt.sources.CsvString: "1997-01-18T16:40:00,A,,9", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") @pytest.mark.skip(reason="shift to literal not supported") @@ -25,7 +24,7 @@ def test_shift_to_datetime(source, golden) -> None: time = source.col("time") shift_to_datetime = datetime(1996, 12, 25, 0, 0, 0) golden.jsonl( - kt.record( + kd.record( {"time": time, "shift_to_time_plus_1_day": time.shift_to(shift_to_datetime)} ) ) @@ -35,7 +34,7 @@ def test_shift_to_column(source, golden) -> None: time = source.col("time") shift_by_timedelta = timedelta(seconds=10) golden.jsonl( - kt.record( + kd.record( { "time": time, "time_plus_seconds": time.shift_to(time.time_of() + shift_by_timedelta), diff --git a/sparrow-py/pytests/shift_until_test.py b/python/pytests/shift_until_test.py similarity index 83% rename from sparrow-py/pytests/shift_until_test.py rename to python/pytests/shift_until_test.py index 6ee6eae4a..92f004965 100644 --- a/sparrow-py/pytests/shift_until_test.py +++ b/python/pytests/shift_until_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,14 +15,14 @@ def source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_shift_until_predicate(source, golden) -> None: m = source.col("m") predicate = m.sum() > 30 golden.jsonl( - kt.record( + kd.record( { "m": m, "sum_m": m.sum(), diff --git a/sparrow-py/pytests/source_test.py b/python/pytests/source_test.py similarity index 88% rename from sparrow-py/pytests/source_test.py rename to python/pytests/source_test.py index 30857aed1..1d8e8a72e 100644 --- a/sparrow-py/pytests/source_test.py +++ b/python/pytests/source_test.py @@ -1,8 +1,7 @@ +import kaskada as kd import pyarrow as pa import pytest -import sparrow_py as kt - def test_table_valid() -> None: schema = pa.schema( @@ -12,7 +11,7 @@ def test_table_valid() -> None: ] ) - kt.sources.Source(schema, time_column_name="time", key_column_name="key") + kd.sources.Source(schema, time_column_name="time", key_column_name="key") def test_table_invalid_names() -> None: @@ -27,7 +26,7 @@ def test_table_invalid_names() -> None: # Currently, this doesn't propagate the suggestions from # existing column names from Sparrow. # TODO: Do that. - kt.sources.Source( + kd.sources.Source( schema, time_column_name="non_existant_time", key_column_name="key" ) @@ -35,7 +34,7 @@ def test_table_invalid_names() -> None: # Currently, this doesn't propagate the suggestions from # existing column names from Sparrow. # TODO: Do that. - kt.sources.Source( + kd.sources.Source( schema, time_column_name="time", key_column_name="non_existant_key" ) @@ -43,7 +42,7 @@ def test_table_invalid_names() -> None: # Currently, this doesn't propagate the suggestions from # existing column names from Sparrow. # TODO: Do that. - kt.sources.Source( + kd.sources.Source( schema, time_column_name="time", key_column_name="key", diff --git a/sparrow-py/pytests/time_of_test.py b/python/pytests/time_of_test.py similarity index 82% rename from sparrow-py/pytests/time_of_test.py rename to python/pytests/time_of_test.py index dc929de8d..74308ff6a 100644 --- a/sparrow-py/pytests/time_of_test.py +++ b/python/pytests/time_of_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,14 +15,14 @@ def source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_time_of(source, golden) -> None: m = source.col("m") n = source.col("n") golden.jsonl( - kt.record( + kd.record( { "m": m, "time_of_m": m.time_of(), diff --git a/sparrow-py/pytests/time_test.py b/python/pytests/time_test.py similarity index 68% rename from sparrow-py/pytests/time_test.py rename to python/pytests/time_test.py index 5a8e721f0..b24fe8bcb 100644 --- a/sparrow-py/pytests/time_test.py +++ b/python/pytests/time_test.py @@ -1,12 +1,11 @@ from datetime import timedelta +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,n", @@ -16,37 +15,37 @@ def source() -> kt.sources.CsvString: "1997-01-18T16:40:00,A,,9", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_time_add_days(source, golden) -> None: time = source.col("time") - golden.jsonl(kt.record({"time": time, "time_plus_day": time + timedelta(days=1)})) + golden.jsonl(kd.record({"time": time, "time_plus_day": time + timedelta(days=1)})) def test_time_add_hours(source, golden) -> None: time = source.col("time") golden.jsonl( - kt.record({"time": time, "time_plus_hours": time + timedelta(hours=1)}) + kd.record({"time": time, "time_plus_hours": time + timedelta(hours=1)}) ) def test_time_add_minutes(source, golden) -> None: time = source.col("time") golden.jsonl( - kt.record({"time": time, "time_plus_minutes": time + timedelta(minutes=1)}) + kd.record({"time": time, "time_plus_minutes": time + timedelta(minutes=1)}) ) def test_time_add_days_and_minutes(source, golden) -> None: time = source.col("time") golden.jsonl( - kt.record({"time": time, "time_plus_day": time + timedelta(days=3, minutes=1)}) + kd.record({"time": time, "time_plus_day": time + timedelta(days=3, minutes=1)}) ) def test_time_add_seconds(source, golden) -> None: time = source.col("time") golden.jsonl( - kt.record({"time": time, "time_plus_seconds": time + timedelta(seconds=5)}) + kd.record({"time": time, "time_plus_seconds": time + timedelta(seconds=5)}) ) diff --git a/sparrow-py/pytests/timestream_test.py b/python/pytests/timestream_test.py similarity index 95% rename from sparrow-py/pytests/timestream_test.py rename to python/pytests/timestream_test.py index 5ebbed633..9e2a85a98 100644 --- a/sparrow-py/pytests/timestream_test.py +++ b/python/pytests/timestream_test.py @@ -1,13 +1,12 @@ import sys +import kaskada as kd import pyarrow as pa import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source1() -> kt.sources.Source: +def source1() -> kd.sources.Source: schema = pa.schema( [ pa.field("time", pa.int32(), nullable=False), @@ -16,7 +15,7 @@ def source1() -> kt.sources.Source: pa.field("y", pa.int32()), ] ) - return kt.sources.Source(schema, time_column_name="time", key_column_name="key") + return kd.sources.Source(schema, time_column_name="time", key_column_name="key") def test_field_ref(source1) -> None: @@ -112,7 +111,7 @@ def test_timestream_preview(golden) -> None: "1996-12-19T16:40:02,A,,", ] ) - source = kt.sources.CsvString( + source = kd.sources.CsvString( content, time_column_name="time", key_column_name="key" ) @@ -131,7 +130,7 @@ def test_timestream_run_non_record(golden) -> None: "1996-12-19T16:40:02,A,,", ] ) - source = kt.sources.CsvString( + source = kd.sources.CsvString( content, time_column_name="time", key_column_name="key" ) golden.jsonl(source.col("m")) @@ -149,7 +148,7 @@ def test_timestream_cast(golden) -> None: "1996-12-19T16:40:02,A,,", ] ) - source = kt.sources.CsvString( + source = kd.sources.CsvString( content, time_column_name="time", key_column_name="key" ) golden.jsonl(source.col("time").cast(pa.timestamp("ns"))) diff --git a/sparrow-py/pytests/udf_test.py b/python/pytests/udf_test.py similarity index 87% rename from sparrow-py/pytests/udf_test.py rename to python/pytests/udf_test.py index ff5400d83..c60b1f6ee 100644 --- a/sparrow-py/pytests/udf_test.py +++ b/python/pytests/udf_test.py @@ -1,9 +1,8 @@ import pandas as pd import pyarrow as pa -from sparrow_py.udf import Udf -from sparrow_py.udf import fenl_udf - -from sparrow_py._ffi import call_udf +from kaskada._ffi import call_udf +from kaskada.udf import Udf +from kaskada.udf import fenl_udf @fenl_udf("add", "add(x: number, y: number) -> number") diff --git a/sparrow-py/pytests/union_test.py b/python/pytests/union_test.py similarity index 92% rename from sparrow-py/pytests/union_test.py rename to python/pytests/union_test.py index 98840a53a..060f05b1e 100644 --- a/sparrow-py/pytests/union_test.py +++ b/python/pytests/union_test.py @@ -1,8 +1,8 @@ -import sparrow_py as kt +import kaskada as kd def test_union(golden) -> None: - source = kt.sources.PyList( + source = kd.sources.PyList( [ {"time": "1996-12-19T16:39:57", "user": "A", "m": [5], "n": []}, {"time": "1996-12-19T17:39:57", "user": "A", "m": [], "n": [5, 6]}, diff --git a/sparrow-py/pytests/with_key_test.py b/python/pytests/with_key_test.py similarity index 87% rename from sparrow-py/pytests/with_key_test.py rename to python/pytests/with_key_test.py index b05029dd3..a51cf41b4 100644 --- a/sparrow-py/pytests/with_key_test.py +++ b/python/pytests/with_key_test.py @@ -1,10 +1,9 @@ +import kaskada as kd import pytest -import sparrow_py as kt - @pytest.fixture(scope="module") -def source() -> kt.sources.CsvString: +def source() -> kd.sources.CsvString: content = "\n".join( [ "time,key,m,new_key", @@ -16,7 +15,7 @@ def source() -> kt.sources.CsvString: "1996-12-19T16:40:02,A,,C", ] ) - return kt.sources.CsvString(content, time_column_name="time", key_column_name="key") + return kd.sources.CsvString(content, time_column_name="time", key_column_name="key") def test_with_key_literal(source, golden) -> None: diff --git a/sparrow-py/requirements-dev.txt b/python/requirements-dev.txt similarity index 100% rename from sparrow-py/requirements-dev.txt rename to python/requirements-dev.txt diff --git a/sparrow-py/src/error.rs b/python/src/error.rs similarity index 92% rename from sparrow-py/src/error.rs rename to python/src/error.rs index a6d4ac5cb..07ae89768 100644 --- a/sparrow-py/src/error.rs +++ b/python/src/error.rs @@ -4,9 +4,9 @@ use pyo3::PyErr; #[derive(derive_more::Display, Debug)] pub enum ErrorContext { - #[display(fmt = "error in sparrow-py Rust code")] + #[display(fmt = "error in kaskada Rust code")] Ffi, - #[display(fmt = "error in sparrow-py Pyo3 or Python code")] + #[display(fmt = "error in kaskada Pyo3 or Python code")] Python, #[display(fmt = "result already collected")] ResultAlreadyCollected, @@ -63,7 +63,7 @@ impl From for Error { impl From for PyErr { fn from(value: Error) -> Self { - tracing::error!("Reporting error from sparrow-py FFI:{value:#}"); + tracing::error!("Reporting error from kaskada FFI:{value:#}"); value .0 .frames() diff --git a/sparrow-py/src/execution.rs b/python/src/execution.rs similarity index 100% rename from sparrow-py/src/execution.rs rename to python/src/execution.rs diff --git a/sparrow-py/src/expr.rs b/python/src/expr.rs similarity index 100% rename from sparrow-py/src/expr.rs rename to python/src/expr.rs diff --git a/sparrow-py/src/lib.rs b/python/src/lib.rs similarity index 100% rename from sparrow-py/src/lib.rs rename to python/src/lib.rs diff --git a/sparrow-py/src/session.rs b/python/src/session.rs similarity index 100% rename from sparrow-py/src/session.rs rename to python/src/session.rs diff --git a/sparrow-py/src/table.rs b/python/src/table.rs similarity index 100% rename from sparrow-py/src/table.rs rename to python/src/table.rs diff --git a/sparrow-py/src/udf.rs b/python/src/udf.rs similarity index 100% rename from sparrow-py/src/udf.rs rename to python/src/udf.rs diff --git a/sparrow-py/example.py b/sparrow-py/example.py deleted file mode 100644 index 375dddc3b..000000000 --- a/sparrow-py/example.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Simple script for testing error handling.""" - -from sparrow_py import Expr -from sparrow_py.math import add -from sparrow_py.math import typeerror - -foo = Expr('foo') -bar = Expr('bar') - - -print(str(foo['pipe'])) - -# foo.pipe(typeerror, bar) - - -foo + typeerror(foo, bar) \ No newline at end of file