Skip to content

Commit

Permalink
Remove print statement and add linting (#45)
Browse files Browse the repository at this point in the history
* Remove print statement and add linting

* import future to ensure backward compatbiltity

* fix imports

* add dummy migration guide to prevent linkcheck failure
  • Loading branch information
noklam committed Sep 20, 2023
1 parent a631c1a commit 315073e
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
8 changes: 3 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ repos:
rev: v0.0.277
hooks:
- id: ruff
name: "ruff on tests/ and docs/"
# PLR2004: Magic value used
# PLR0913: Too many arguments
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix", "--ignore=PLR2004,PLR0913"]
name: "Ruff"
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
# include: "tests"
exclude: "^kedro/templates/|^features/steps/test_starter/|kedro"
# exclude: ""
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**General informations**

[![Python Version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue.svg)](https://pypi.org/project/kedro-pandera/) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Code Style: Black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/ambv/black)
[![Python Version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue.svg)](https://pypi.org/project/kedro-pandera/) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0/) [![Code Style: Black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/ambv/black)
[![SemVer](https://img.shields.io/badge/semver-2.0.0-green)](https://semver.org/)

----------------------------------------------------------
Expand Down Expand Up @@ -48,7 +48,7 @@ The [release history](https://github.com/Galileo-Galilei/kedro-pandera/blob/main

This package is still in active development. We use [SemVer](https://semver.org/) principles to version our releases. Until we reach `1.0.0` milestone, breaking changes will lead to `<minor>` version number increment, while releases which do not introduce breaking changes in the API will lead to `<patch>` version number increment.

If you want to see how to migrate from one version of `kedro-pandera` to another, see the [migration guide](../docs/migration_guide.md).
If you want to see how to migrate from one version of `kedro-pandera` to another, see the [migration guide](./docs/source/migration_guide.md).

# Can I contribute?

Expand Down
Empty file added docs/source/migration_guide.md
Empty file.
5 changes: 3 additions & 2 deletions kedro_pandera/framework/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

from pathlib import Path
from typing import Optional

import click
import frictionless # noqa: F401
Expand Down Expand Up @@ -63,7 +64,7 @@ def infer_dataset_schema(
dataset_name: str,
use_python_ext: bool = False,
env: str = "base",
outfile: Optional[str] = None,
outfile: str | None = None,
):
"""Infer the schema of a dataset and dump it in a catalog file
so that it will enable validation at runtime.
Expand Down
1 change: 0 additions & 1 deletion kedro_pandera/framework/config/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ def resolve_dataframe_model(schema_name):

module, _, schema = schema_name.rpartition(".")
module = importlib.import_module(module)
print(f"{module=} {getattr(module, schema)=}")
return getattr(module, schema)
2 changes: 1 addition & 1 deletion kedro_pandera/framework/hooks/pandera_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from pandera.errors import SchemaError

from kedro_pandera.framework.config.resolvers import (
resolve_dataframe_model,
resolve_interpolated_yaml_schema,
resolve_yaml_schema,
resolve_dataframe_model,
)

# if we do not import ``frictionless`` manually here, we get
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ select = [
"UP", # pyupgrade
"I", # isort
"PL", # Pylint
"T201", # Print Statement
]
ignore = ["E501"] # Black take care off line-too-long
unfixable = []

[tool.ruff.per-file-ignores]
"{tests,docs}/*" = ["T201"] # Check print statement for kedro/ only
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ WARNING: Please do not put access credentials in the base configuration folder.


## Find out more
You can find out more about configuration from the [user guide documentation](https://kedro.readthedocs.io/en/stable/user_guide/configuration.html).
You can find out more about configuration from the [user guide documentation](https://docs.kedro.org/en/stable/configuration/configuration_basics.html).

0 comments on commit 315073e

Please sign in to comment.