Skip to content

Commit

Permalink
Remove safety from the optional lint dependencies as it's not used …
Browse files Browse the repository at this point in the history
…in this project. (#49)

Co-authored-by: Daniel Krebs <[email protected]>
  • Loading branch information
cipherself and daniel-k authored Oct 21, 2024
1 parent 3d2d564 commit 077c3d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
html_static_path = ["_static"]

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

nitpicky = True
nitpick_ignore_regex = [
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = [
"version",
Expand All @@ -38,7 +39,6 @@ optional-dependencies.lint = [
"isort",
"mypy",
"pyproject-fmt",
"safety",
"tox-ini-fmt",
]
optional-dependencies.test = [
Expand Down
15 changes: 8 additions & 7 deletions src/enlyze/schema.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING: # pragma: no cover
from _typeshed import DataclassInstance
import typing
from dataclasses import is_dataclass
from types import UnionType
from typing import Any, Protocol

import pandas


class DataclassTypeOrInstance(Protocol):
__dataclass_fields__: dict[str, Any]


def _flat_dataclass_schema(
dataclass_obj_or_type: DataclassTypeOrInstance,
dataclass_obj_or_type: DataclassInstance | type[DataclassInstance],
path_separator: str,
_parent_path: list[str] = [],
) -> list[str]:
Expand Down Expand Up @@ -42,7 +43,7 @@ def _flat_dataclass_schema(

def dataframe_ensure_schema(
df: pandas.DataFrame,
dataclass_obj_or_type: DataclassTypeOrInstance,
dataclass_obj_or_type: DataclassInstance | type[DataclassInstance],
path_separator: str = ".",
) -> pandas.DataFrame:
"""Add missing columns to ``df`` based on flattened dataclass schema"""
Expand Down

0 comments on commit 077c3d3

Please sign in to comment.