Skip to content

Commit

Permalink
[Subhankar] update project structure (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
subhankarb authored Sep 5, 2024
1 parent 3f9f578 commit 1af627f
Show file tree
Hide file tree
Showing 123 changed files with 1,052 additions and 1,112 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to Datachecks
# Contributing to DCS Core

Thank you for considering contributing to Datachecks!

Expand Down Expand Up @@ -31,7 +31,7 @@ git clone git@github.com:USERNAME/datachecks.git
#### Keeping Your Fork Up to Date
```bash
# Add 'upstream' repo to list of remotes
git remote add upstream https://github.com/waterdipai/datachecks
git remote add upstream https://github.com/datachecks/dcs-core

# Verify the new remote named 'upstream'
git remote -v
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RUN pip install --no-cache-dir poetry==1.1.13
COPY . /app
WORKDIR /app
RUN poetry install
ENTRYPOINT ["poetry", "python3", "run", "-m" , "datachecks"]
ENTRYPOINT ["poetry", "python3", "run", "-m" , "dcs-core"]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
APM (Application Performance Monitoring) tools are used to monitor the performance of applications. APM tools are mandatory part of dev stack. Without AMP tools, it is very difficult to monitor the performance of applications.

<p align="center">
<img alt="why_data_observability" src="https://raw.githubusercontent.com/waterdipai/datachecks/main/docs/assets/datachecks_why_data_observability.svg" width="800">
<img alt="why_data_observability" src="https://raw.githubusercontent.com/datachecks/dcs-core/main/docs/assets/datachecks_why_data_observability.svg" width="800">
</p>

But for Data products regular APM tools are not enough. We need a new kind of tools that can monitor the performance of Data applications.
Expand All @@ -47,15 +47,15 @@ You can generate with just one command. It generates a beautiful data quality re
This html report can be shared with the team.

<p align="center">
<img alt="why_data_observability" src="docs/assets/datachecks_dashboard.png" width="800">
<img alt="why_data_observability" src="https://raw.githubusercontent.com/datachecks/dcs-core/main/docs/assets/datachecks_dashboard.png" width="800">
</p>

### CLI: Data Quality Visualisation in Bash

Data quality report can be generated in the terminal. It is very useful for debugging. All it takes is one command.

<p align="center">
<img alt="why_data_observability" src="docs/assets/datachecks_cli_output.png" width="800">
<img alt="why_data_observability" src="https://raw.githubusercontent.com/datachecks/dcs-core/main/docs/assets/datachecks_cli_output.png" width="800">
</p>

## Getting Started
Expand All @@ -67,7 +67,7 @@ Install `datachecks` with the command that is specific to the database.
To install all datachecks dependencies, use the below command.

```shell
pip install datachecks -U
pip install dcs-core -U
```

### Create the config file
Expand All @@ -84,13 +84,13 @@ For more details, please visit the [config guide](https://docs.datachecks.io/con
**Generate Report in Terminal**

```shell
datachecks inspect -C config.yaml
dcs-core inspect -C config.yaml
```

**Generate HTML Report**

```shell
datachecks inspect -C config.yaml --html-report
dcs-core inspect -C config.yaml --html-report
```

Please visit the [Quick Start Guide](https://docs.datachecks.io/getting_started/)
Expand Down Expand Up @@ -124,13 +124,13 @@ Datachecks supports sql and search data sources. Below are the list of supported
## Overview

<p align="center">
<img alt="datacheck_architecture" src="https://raw.githubusercontent.com/waterdipai/datachecks/main/docs/assets/data_check_architecture.svg" width="800">
<img alt="datacheck_architecture" src="https://raw.githubusercontent.com/datachecks/dcs-core/main/docs/assets/data_check_architecture.svg" width="800">
</p>

## What Datacheck does not do?

<p align="middle">
<img alt="" src="https://raw.githubusercontent.com/waterdipai/datachecks/main/docs/assets/datachecks_does_not_do.svg" width="800"/>
<img alt="" src="https://raw.githubusercontent.com/datachecks/dcs-core/main/docs/assets/datachecks_does_not_do.svg" width="800"/>
</p>

## Community & Support
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion datachecks/__main__.py → dcs_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from datachecks.cli.cli import main
from dcs_core.cli.cli import main

if __name__ == "__main__":
main()
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions datachecks/cli/cli.py → dcs_core/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
from rich import print
from rich.table import Table, Text

from datachecks.__version__ import __version__
from datachecks.core import Configuration, Inspect
from datachecks.core.configuration.configuration_parser import load_configuration
from dcs_core.__version__ import __version__
from dcs_core.core import Configuration, Inspect
from dcs_core.core.configuration.configuration_parser import load_configuration

# from datachecks.core.common.models.metric import DataSourceMetrics
from datachecks.core.inspect import InspectOutput
from datachecks.report.dashboard import DashboardInfoBuilder, html_template
from datachecks.report.models import TemplateParams
from dcs_core.core.inspect import InspectOutput
from dcs_core.report.dashboard import DashboardInfoBuilder, html_template
from dcs_core.report.models import TemplateParams

logger.remove()
logger.add(sys.stderr, level="WARNING")
Expand Down
4 changes: 2 additions & 2 deletions datachecks/core/__init__.py → dcs_core/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from datachecks.core.configuration.configuration_parser import (
from dcs_core.core.configuration.configuration_parser import (
Configuration,
load_configuration,
)
from datachecks.core.inspect import Inspect
from dcs_core.core.inspect import Inspect
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
from enum import Enum
from typing import Any, Dict, List, Optional, Union

from datachecks.core.common.models.data_source_resource import Field, Index, Table
from datachecks.core.common.models.metric import MetricsType
from datachecks.core.common.models.validation import (
from dcs_core.core.common.models.data_source_resource import Field, Index, Table
from dcs_core.core.common.models.metric import MetricsType
from dcs_core.core.common.models.validation import (
Threshold,
Validation,
ValidationFunction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from dataclasses import dataclass
from typing import List

from datachecks.core.common.models.widget import BaseWidgetInfo
from dcs_core.core.common.models.widget import BaseWidgetInfo


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import pytz
from dateutil import parser

from datachecks.core.utils.utils import EnhancedJSONEncoder
from dcs_core.core.utils.utils import EnhancedJSONEncoder


class MetricsType(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from dataclasses import dataclass
from typing import List, Optional

from datachecks.core.common.models.metric import MetricsType, MetricValue
from dcs_core.core.common.models.metric import MetricsType, MetricValue


@dataclass
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from pyparsing import Optional as OptionalParsing
from pyparsing import Word, delimitedList, nums, oneOf

from datachecks.core.common.errors import DataChecksConfigurationError
from datachecks.core.common.models.configuration import (
from dcs_core.core.common.errors import DataChecksConfigurationError
from dcs_core.core.common.models.configuration import (
Configuration,
DataSourceConfiguration,
DataSourceConnectionConfiguration,
Expand All @@ -31,14 +31,10 @@
ValidationConfig,
ValidationConfigByDataset,
)
from datachecks.core.common.models.data_source_resource import Field, Index, Table
from datachecks.core.common.models.metric import MetricsType
from datachecks.core.common.models.validation import (
ConditionType,
Threshold,
Validation,
)
from datachecks.core.configuration.config_loader import parse_config
from dcs_core.core.common.models.data_source_resource import Field, Index, Table
from dcs_core.core.common.models.metric import MetricsType
from dcs_core.core.common.models.validation import ConditionType, Threshold, Validation
from dcs_core.core.configuration.config_loader import parse_config

CONDITION_TYPE_MAPPING = {
">=": ConditionType.GTE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from pyparsing import Optional as OptionalParsing
from pyparsing import Word, delimitedList, nums, oneOf

from datachecks.core.common.errors import DataChecksConfigurationError
from datachecks.core.common.models.configuration import (
from dcs_core.core.common.errors import DataChecksConfigurationError
from dcs_core.core.common.models.configuration import (
Configuration,
DataSourceConfiguration,
DataSourceConnectionConfiguration,
Expand All @@ -32,14 +32,10 @@
MetricStorageConfiguration,
MetricStorageType,
)
from datachecks.core.common.models.data_source_resource import Field, Index, Table
from datachecks.core.common.models.metric import MetricsType
from datachecks.core.common.models.validation import (
ConditionType,
Threshold,
Validation,
)
from datachecks.core.configuration.config_loader import parse_config
from dcs_core.core.common.models.data_source_resource import Field, Index, Table
from dcs_core.core.common.models.metric import MetricsType
from dcs_core.core.common.models.validation import ConditionType, Threshold, Validation
from dcs_core.core.configuration.config_loader import parse_config

CONDITION_TYPE_MAPPING = {
">=": ConditionType.GTE,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from abc import ABC
from typing import Any, Dict, Optional

from datachecks.core.common.models.configuration import DataSourceLanguageSupport
from dcs_core.core.common.models.configuration import DataSourceLanguageSupport


class DataSource(ABC):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
from dataclasses import asdict
from typing import Dict, List

from datachecks.core.common.errors import DataChecksDataSourcesConnectionError
from datachecks.core.common.models.configuration import (
from dcs_core.core.common.errors import DataChecksDataSourcesConnectionError
from dcs_core.core.common.models.configuration import (
Configuration,
DataSourceConfiguration,
)
from datachecks.core.datasource.base import DataSource
from dcs_core.core.datasource.base import DataSource


class DataSourceManager:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from dateutil import parser

from datachecks.core.datasource.base import DataSource
from dcs_core.core.datasource.base import DataSource


class SearchIndexDataSource(DataSource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from sqlalchemy import inspect, text
from sqlalchemy.engine import Connection

from datachecks.core.datasource.base import DataSource
from dcs_core.core.datasource.base import DataSource


class SQLDataSource(DataSource):
Expand Down
30 changes: 8 additions & 22 deletions datachecks/core/inspect.py → dcs_core/core/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,25 @@
import requests
from loguru import logger

from datachecks.core.common.errors import DataChecksRuntimeError
from datachecks.core.common.models.configuration import (
Configuration,
MetricStorageConfiguration,
MetricStorageType,
)
from datachecks.core.common.models.metric import (
from dcs_core.core.common.models.configuration import Configuration
from dcs_core.core.common.models.metric import (
CombinedMetrics,
DataSourceMetrics,
IndexMetrics,
MetricValue,
TableMetrics,
)
from datachecks.core.common.models.validation import ValidationInfo
from datachecks.core.configuration.configuration_parser import (
from dcs_core.core.common.models.validation import ValidationInfo
from dcs_core.core.configuration.configuration_parser import (
load_configuration,
load_configuration_from_yaml_str,
)
from datachecks.core.datasource.base import DataSource
from datachecks.core.datasource.manager import DataSourceManager
from datachecks.core.datasource.sql_datasource import SQLDataSource
from datachecks.core.metric.manager import MetricManager
from datachecks.core.profiling.datasource_profiling import DataSourceProfiling
from datachecks.core.repository.metric_repository import MetricRepository
from datachecks.core.utils.tracking import (
create_error_event,
from dcs_core.core.datasource.manager import DataSourceManager
from dcs_core.core.utils.tracking import (
create_inspect_event_json,
is_tracking_enabled,
send_event_json,
)
from datachecks.core.utils.utils import truncate_error
from datachecks.core.validation.manager import ValidationManager
from datachecks.integrations.storage.local_file import LocalFileMetricRepository
from dcs_core.core.utils.utils import truncate_error
from dcs_core.core.validation.manager import ValidationManager

requests.packages.urllib3.disable_warnings(
requests.packages.urllib3.exceptions.InsecureRequestWarning
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from loguru import logger

from datachecks.core.logger.base import MetricLogger
from dcs_core.core.logger.base import MetricLogger


class DefaultLogger(MetricLogger):
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions datachecks/core/metric/base.py → dcs_core/core/metric/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

from loguru import logger

from datachecks.core.common.models.metric import MetricsType, MetricValue
from datachecks.core.common.models.validation import ConditionType
from datachecks.core.datasource.base import DataSource
from datachecks.core.datasource.search_datasource import SearchIndexDataSource
from datachecks.core.datasource.sql_datasource import SQLDataSource
from dcs_core.core.common.models.metric import MetricsType, MetricValue
from dcs_core.core.common.models.validation import ConditionType
from dcs_core.core.datasource.base import DataSource
from dcs_core.core.datasource.search_datasource import SearchIndexDataSource
from dcs_core.core.datasource.sql_datasource import SQLDataSource


class MetricIdentity:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from loguru import logger
from pyparsing import Forward, Group, Suppress, Word, alphas, delimitedList, nums

from datachecks.core.common.models.metric import MetricsType, MetricValue
from datachecks.core.metric.base import Metric, MetricIdentity
from dcs_core.core.common.models.metric import MetricsType, MetricValue
from dcs_core.core.metric.base import Metric, MetricIdentity


class CombinedMetric(Metric):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from datachecks.core.common.models.metric import MetricsType
from datachecks.core.datasource.sql_datasource import SQLDataSource
from datachecks.core.metric.base import Metric, MetricIdentity
from dcs_core.core.common.models.metric import MetricsType
from dcs_core.core.datasource.sql_datasource import SQLDataSource
from dcs_core.core.metric.base import Metric, MetricIdentity


class CustomSqlMetric(Metric):
Expand Down
Loading

0 comments on commit 1af627f

Please sign in to comment.