feat(content): gemeinsamer Integritäts-Mixin für Blob & DataFrame (RFC 0004, Option B)#74
Merged
Merged
Conversation
…C 0004, Option B) ContentIntegrityMixin (sdata/sclass/content.py): sha1/md5/sha256/size + update_checksum/verify über einen content_bytes-Hook + self.metadata. - Blob(ContentIntegrityMixin, Base): die Hash-/verify-/size-Methoden aus blob.py in den Mixin extrahiert (Verhalten identisch, Blob-Tests unverändert grün). - DataFrame(ContentIntegrityMixin, Base): erbt sha256/verify/size; content_bytes = reines Daten-Parquet (self.df.to_parquet(), OHNE _sdata-Embedding). Wichtig: der Hash erfasst die Daten, nicht die Metadaten -> update_checksum (schreibt checksum in die Metadaten) verändert den Hash nicht (Selbstreferenz vermieden). - Keine Vererbung Blob<->DataFrame (RFC-0004-Befund: das fixe-Blob-Modell passt nicht auf die lebende, mehrformatige Tabelle); gemeinsamer Layer per Mixin. - Tests: tests/test_sclass_dataframe_integrity.py (sha256/size, verify match/mismatch, content_bytes == df.to_parquet()). content/blob/dataframe je 100 %. RFC 0004: Option B umgesetzt; offen Option C (DataFrame.as_blob).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setzt RFC 0004, Option B um: ein gemeinsamer Integritäts-/Hash-Layer für
BlobundDataFrame— ohne Vererbung untereinander (RFC-Befund: das fixe-Blob-Modell passt nicht auf die lebende, mehrformatige Tabelle).Was
ContentIntegrityMixin(sdata/sclass/content.py):sha1/md5/sha256/size+update_checksum/verifyüber einencontent_bytes-Hook +self.metadata.Blob(ContentIntegrityMixin, Base)— die Hash-/verify-/size-Methoden ausblob.pyin den Mixin extrahiert (Verhalten identisch; Blob-Tests unverändert grün).DataFrame(ContentIntegrityMixin, Base)— erbtsha256/verify/size/update_checksum;content_bytes= reines Daten-Parquet (self.df.to_parquet(), ohne_sdata-Embedding).Stolperfalle (gefixt)
Mit
content_bytes = self.to_parquet()(mit eingebetteten Metadaten) wäreverify()selbstreferenziell:update_checksum()schreibt die checksum in die Metadaten → diese landen im Parquet → der nächstesha256wäre anders. Lösung: über die Daten hashen (self.df.to_parquet()), nicht über die Metadaten.Tests / Coverage
tests/test_sclass_dataframe_integrity.py(sha256/sha1/md5/size,verifymatch/mismatch,content_bytes == df.to_parquet()). Kanonische CI grün;content.py/blob.py/dataframe.pyje 100 %;mkdocs build --strictexit 0.RFC 0004: Option B umgesetzt; offen nur noch Option C (
DataFrame.as_blob(fmt)).