Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Payne committed Sep 28, 2023
1 parent 3b1ca22 commit 8840ae6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/singerlake/store/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
from pydantic import BaseModel


class SchemaVersion(BaseModel):
"""Schema Version."""

first_observed: str
schema_hash: str


class StreamManifest(BaseModel):
"""Stream Manifest."""

stream_id: str

files: t.List[str] = []
versions: t.Mapping[str, str] = {}
versions: t.List[SchemaVersion] = []


class TapManifest(BaseModel):
Expand Down
9 changes: 5 additions & 4 deletions src/singerlake/store/path_manager/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ def get_record_partitions(
]
return tuple(partitions)

def format_partition(self, partition: Partition) -> str:
"""Format a partition."""
return str(partition.value)

@t.final
def hash_stream_schema(self, stream_schema: t.Mapping[str, t.Any]) -> str:
"""Calculate a unique short-hash for given schema."""
data = json.dumps(stream_schema, sort_keys=True)
Expand Down Expand Up @@ -195,3 +192,7 @@ def transform(self, path: GenericPath) -> t.Any:
Override to transform GenericPath to a different path type.
"""
return self.transformer.transform(path)

def format_partition(self, partition: Partition) -> str:
"""Format a partition."""
return str(partition.value)

0 comments on commit 8840ae6

Please sign in to comment.