Skip to content

Commit

Permalink
code-review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Jul 27, 2023
1 parent 3be83d6 commit a755401
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apis/python/src/tiledbsoma/io/registration/signatures.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json
from dataclasses import dataclass
from typing import Dict, Optional

import anndata as ad
import attrs
import pandas as pd
import pyarrow as pa
from typing_extensions import Self
Expand Down Expand Up @@ -74,7 +74,7 @@ def _string_dict_from_pandas_dataframe(
return _string_dict_from_arrow_schema(arrow_schema)


@dataclass
@attrs.define
class Signature:
"""
This is support for compatibility pre-check for append-mode SOMA ingestion.
Expand Down Expand Up @@ -298,7 +298,9 @@ def _compatible_with(self, other: Self) -> bool:

def toJSON(self) -> str:
"""Presents a signature as JSON which is suitable for distributed logging."""
return json.dumps(self, default=lambda o: o.__dict__, sort_keys=True, indent=4)
return json.dumps(
self, default=lambda o: attrs.asdict(o), sort_keys=True, indent=4
)

@classmethod
def fromJSON(cls, s: str) -> Self:
Expand Down

0 comments on commit a755401

Please sign in to comment.