Skip to content

Commit

Permalink
refactor: derive the _schema automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymonSzyszkowski committed Dec 3, 2024
1 parent a02f9c1 commit 43a710f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gentropy/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class Dataset(ABC):
"""

_df: DataFrame
_schema: StructType

def __post_init__(self: Dataset) -> None:
"""Post init."""
Expand Down Expand Up @@ -64,7 +63,7 @@ def schema(self: Dataset) -> StructType:
Returns:
StructType: Dataframe expected schema
"""
return self._schema
return self.get_schema()

@classmethod
def _process_class_params(
Expand Down Expand Up @@ -172,7 +171,7 @@ def validate_schema(self: Dataset) -> None:
Raises:
SchemaValidationError: If the DataFrame schema does not match the expected schema
"""
expected_schema = self._schema
expected_schema = self.schema
observed_schema = self._df.schema

# Unexpected fields in dataset
Expand Down

0 comments on commit 43a710f

Please sign in to comment.