From a1a19a3c30c39d7facc5794e01d7acf30ed4ca47 Mon Sep 17 00:00:00 2001 From: Sierra Taylor Moxon Date: Mon, 15 Apr 2024 12:22:41 -0700 Subject: [PATCH 1/2] fix parquet sink support --- kgx/__init__.py | 12 ++++++++---- kgx/transformer.py | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/kgx/__init__.py b/kgx/__init__.py index c9ceebc4..e276856a 100644 --- a/kgx/__init__.py +++ b/kgx/__init__.py @@ -1,4 +1,8 @@ -""" -KGX Package -""" -__version__ = "2.1.0" +# use importlib.metadata to read the version provided +# by the package during installation. Do not hardcode +# the version in the code +try: + import importlib.metadata as importlib_metadata +except ModuleNotFoundError: + import importlib_metadata +__version__ = importlib_metadata.version(__name__) \ No newline at end of file diff --git a/kgx/transformer.py b/kgx/transformer.py index 1dcc8204..d1594fc8 100644 --- a/kgx/transformer.py +++ b/kgx/transformer.py @@ -50,6 +50,7 @@ "nt": RdfSource, "owl": OwlSource, "sssom": SssomSource, + "parquet": GraphSource, } SINK_MAP = { From b02b789753b66df05514d7661ad5ada31930c483 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Mon, 15 Apr 2024 16:09:59 -0400 Subject: [PATCH 2/2] Add kgx.sink.parquet_sink to docs --- docs/reference/sink.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/reference/sink.md b/docs/reference/sink.md index baf827fb..c0aba387 100644 --- a/docs/reference/sink.md +++ b/docs/reference/sink.md @@ -142,3 +142,18 @@ formatted JSON. :inherited-members: :show-inheritance: ``` + + +## kgx.sink.parquet_sink + +`ParquetSink` is responsible for writing data as Parquet table files. + +KGX writes two separate files - one for nodes and another for edges. + + +```eval_rst +.. automodule:: kgx.sink.parquet_sink + :members: + :inherited-members: + :show-inheritance: +```