Skip to content

Commit

Permalink
Move docs module to core
Browse files Browse the repository at this point in the history
  • Loading branch information
fjetter committed Oct 18, 2019
1 parent 6e0803c commit 7a2bbb5
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ Version 3.X.X (2019-09-XX)
* `~kartothek.serialization.ConjunctionType`
* `~kartothek.serialization.LiteralType`

Internal changes
^^^^^^^^^^^^^^^^
- Move the docs module from `io_components` to `core`


Version 3.4.0 (2019-09-17)
==========================
Expand Down
7 changes: 2 additions & 5 deletions kartothek/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from kartothek.core._compat import load_json
from kartothek.core._mixins import CopyMixin
from kartothek.core.common_metadata import SchemaWrapper, read_schema_metadata
from kartothek.core.docs import default_docs
from kartothek.core.index import (
ExplicitSecondaryIndex,
IndexBase,
Expand Down Expand Up @@ -349,6 +350,7 @@ def load_partition_indices(self) -> "DatasetMetadataBase":
combined_indices.update(indices)
return self.copy(indices=combined_indices)

@default_docs
def get_indices_as_dataframe(
self,
columns: Optional[List[str]] = None,
Expand All @@ -370,11 +372,6 @@ def get_indices_as_dataframe(
Parameters
----------
columns: list of str
If provided, the dataframe will only be constructed for the provided columns/indices.
If `None` is given, all indices are included.
date_as_object: bool, optional
Cast dates to objects.
"""
if columns is None:
columns = sorted(self.indices.keys())
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions kartothek/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from kartothek.core._compat import ARROW_LARGER_EQ_0150
from kartothek.core._mixins import CopyMixin
from kartothek.core.common_metadata import normalize_type
from kartothek.core.docs import default_docs
from kartothek.core.urlencode import quote
from kartothek.serialization import (
PredicatesType,
Expand Down Expand Up @@ -427,6 +428,7 @@ def __eq__(self, other) -> bool:
def __ne__(self, other) -> bool:
return not (self == other)

@default_docs
def as_flat_series(
self,
compact: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion kartothek/io/dask/bag.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import dask.bag as db

from kartothek.core import naming
from kartothek.core.docs import default_docs
from kartothek.core.factory import _ensure_factory
from kartothek.core.utils import _check_callable
from kartothek.core.uuid import gen_uuid
Expand All @@ -14,7 +15,6 @@
_identity,
_maybe_get_categoricals_from_index,
)
from kartothek.io_components.docs import default_docs
from kartothek.io_components.index import update_indices_from_partitions
from kartothek.io_components.metapartition import (
MetaPartition,
Expand Down
2 changes: 1 addition & 1 deletion kartothek/io/dask/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import numpy as np

from kartothek.core.common_metadata import empty_dataframe_from_schema
from kartothek.core.docs import default_docs
from kartothek.core.factory import _ensure_factory
from kartothek.core.naming import DEFAULT_METADATA_VERSION
from kartothek.io_components.docs import default_docs
from kartothek.io_components.metapartition import parse_input_to_metapartition
from kartothek.io_components.update import update_dataset_from_partitions
from kartothek.io_components.utils import (
Expand Down
2 changes: 1 addition & 1 deletion kartothek/io/dask/delayed.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from dask import delayed

from kartothek.core import naming
from kartothek.core.docs import default_docs
from kartothek.core.factory import _ensure_factory
from kartothek.core.naming import DEFAULT_METADATA_VERSION
from kartothek.core.utils import _check_callable
Expand All @@ -17,7 +18,6 @@
delete_indices,
delete_top_level_metadata,
)
from kartothek.io_components.docs import default_docs
from kartothek.io_components.gc import delete_files, dispatch_files_to_gc
from kartothek.io_components.merge import align_datasets
from kartothek.io_components.metapartition import (
Expand Down
2 changes: 1 addition & 1 deletion kartothek/io/eager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
store_schema_metadata,
)
from kartothek.core.dataset import DatasetMetadataBuilder
from kartothek.core.docs import default_docs
from kartothek.core.factory import _ensure_factory
from kartothek.core.naming import (
DEFAULT_METADATA_STORAGE_FORMAT,
Expand All @@ -24,7 +25,6 @@
delete_indices,
delete_top_level_metadata,
)
from kartothek.io_components.docs import default_docs
from kartothek.io_components.gc import delete_files, dispatch_files_to_gc
from kartothek.io_components.index import update_indices_from_partitions
from kartothek.io_components.metapartition import (
Expand Down
2 changes: 1 addition & 1 deletion kartothek/io/iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from functools import partial
from typing import cast

from kartothek.core.docs import default_docs
from kartothek.core.factory import _ensure_factory
from kartothek.core.naming import (
DEFAULT_METADATA_STORAGE_FORMAT,
DEFAULT_METADATA_VERSION,
)
from kartothek.core.uuid import gen_uuid
from kartothek.io_components.docs import default_docs
from kartothek.io_components.metapartition import (
MetaPartition,
parse_input_to_metapartition,
Expand Down
2 changes: 1 addition & 1 deletion kartothek/io_components/metapartition.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
validate_compatible,
validate_shared_columns,
)
from kartothek.core.docs import default_docs
from kartothek.core.index import ExplicitSecondaryIndex, IndexBase
from kartothek.core.index import merge_indices as merge_indices_algo
from kartothek.core.naming import get_partition_file_prefix
from kartothek.core.partition import Partition
from kartothek.core.urlencode import decode_key, quote_indices
from kartothek.core.utils import ensure_string_type, verify_metadata_version
from kartothek.core.uuid import gen_uuid
from kartothek.io_components.docs import default_docs
from kartothek.io_components.utils import _instantiate_store, combine_metadata
from kartothek.serialization import (
DataFrameSerializer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest

from kartothek.core.docs import _PARAMETER_MAPPING
from kartothek.io.dask.bag import (
build_dataset_indices__bag,
read_dataset_as_dataframe_bag,
Expand Down Expand Up @@ -37,7 +38,6 @@
store_dataframes_as_dataset__iter,
update_dataset_from_dataframes__iter,
)
from kartothek.io_components.docs import _PARAMETER_MAPPING


@pytest.mark.parametrize(
Expand Down

0 comments on commit 7a2bbb5

Please sign in to comment.