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

Fix profile bug #168

Merged
merged 2 commits into from
Feb 1, 2023
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Recap makes it easy for engineers to build infrastructure and tools that need me
* Supports major cloud data warehouses and Postgres
* No external system dependencies required
* Designed for the [CLI](https://docs.recap.cloud/latest/cli/)
* Runs as a Python library or [REST API](https://docs.recap.cloud/latest/rest/)
* Runs as a [Python API](https://docs.recap.cloud/latest/api/recap.analyzers/) or [REST API](https://docs.recap.cloud/latest/rest/)
* Fully [pluggable](https://docs.recap.cloud/latest/guides/plugins/)

## Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Recap makes it easy for engineers to build infrastructure and tools that need me
* Supports major cloud data warehouses and PostgreSQL
* No external system dependencies required
* Designed for the [CLI](cli.md)
* Runs as a Python library or [REST API](rest.md)
* Runs as a [Python API](api/recap.analyzers.md) or [REST API](rest.md)
* Fully [pluggable](guides/plugins.md)

## Installation
Expand Down
44 changes: 22 additions & 22 deletions recap/analyzers/sqlalchemy/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sqlalchemy
from .columns import TableColumnAnalyzer, Columns
from contextlib import contextmanager
from pydantic import BaseModel
from pydantic import BaseModel, Field
from recap.analyzers.abstract import AbstractAnalyzer, BaseMetadataModel
from recap.browsers.db import create_browser, TablePath, ViewPath
from typing import Generator
Expand All @@ -16,36 +16,36 @@ class BaseColumnProfile(BaseModel):


class BinaryColumnProfile(BaseColumnProfile):
min_length: int | None
max_length: int | None
distinct: int | None
nulls: int | None
min_length: int | None = Field(...)
max_length: int | None = Field(...)
distinct: int | None = Field(...)
nulls: int | None = Field(...)


class DateColumnProfile(BaseColumnProfile):
min: str | None
max: str | None
distinct: int | None
nulls: int | None
unix_epochs: int | None
min: str | None = Field(...)
max: str | None = Field(...)
distinct: int | None = Field(...)
nulls: int | None = Field(...)
unix_epochs: int | None = Field(...)


class NumericColumnProfile(BaseColumnProfile):
min: int | float | None
max: int | float | None
average: int | float | None
sum: int | float | None
nulls: int | None
zeros: int | None
negatives: int | None
min: int | float | None = Field(...)
max: int | float | None = Field(...)
average: int | float | None = Field(...)
sum: int | float | None = Field(...)
nulls: int | None = Field(...)
zeros: int | None = Field(...)
negatives: int | None = Field(...)


class StringColumnProfile(BaseColumnProfile):
min_length: int | None
max_length: int | None
distinct: int | None
nulls: int | None
empty_strings: int | None
min_length: int | None = Field(...)
max_length: int | None = Field(...)
distinct: int | None = Field(...)
nulls: int | None = Field(...)
empty_strings: int | None = Field(...)


ColumnProfile = (
Expand Down