Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pydantic-based Definitions of Structures #875

Merged
merged 6 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Write the date in place of the "Unreleased" in the case a new version is release

# Changelog

## Unreleased

### Maintenance
- Remove pydentic-based definitions of structures and use dataclasses instead.

## v0.1.0-b17 (2024-01-29)

### Changed
Expand Down
2 changes: 1 addition & 1 deletion tiled/adapters/sparse.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any, Dict, List, Optional, Tuple, Union

import dask
import dask.dataframe
import numpy
import pandas
import sparse
Expand Down
3 changes: 2 additions & 1 deletion tiled/catalog/adapter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import collections
import copy
import dataclasses
import importlib
import itertools as it
import logging
Expand Down Expand Up @@ -1180,7 +1181,7 @@ def _prepare_structure(structure_family, structure):
"Convert from pydantic model to dict."
if structure is None:
return None
return structure.model_dump()
return dataclasses.asdict(structure)


def binary_op(query, tree, operation):
Expand Down
192 changes: 0 additions & 192 deletions tiled/server/pydantic_array.py

This file was deleted.

12 changes: 0 additions & 12 deletions tiled/server/pydantic_awkward.py

This file was deleted.

19 changes: 0 additions & 19 deletions tiled/server/pydantic_sparse.py

This file was deleted.

77 changes: 0 additions & 77 deletions tiled/server/pydantic_table.py

This file was deleted.

8 changes: 4 additions & 4 deletions tiled/server/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
from pydantic_core import PydanticCustomError
from typing_extensions import Annotated, TypedDict

from ..structures.array import ArrayStructure
from ..structures.awkward import AwkwardStructure
from ..structures.core import StructureFamily
from ..structures.data_source import Management
from .pydantic_array import ArrayStructure
from .pydantic_awkward import AwkwardStructure
from .pydantic_sparse import SparseStructure
from .pydantic_table import TableStructure
from ..structures.sparse import SparseStructure
from ..structures.table import TableStructure

if TYPE_CHECKING:
import tiled.authn_database.orm
Expand Down