-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: use inheritance to improve our code base (#47)
* fix: interpolations erros and other things reported by sourcery-ai * feat: use inheritance to improve the code base * fix: sourcery refactored * chore: update pre commit rules * fix: remove noqa F401 comments * fix: remove duplicate and unused imports in base_client.py * feat: use enum instance literals in base_request_builder.py * pref: cast session only once in __init__ * pref: remove unnecesary cast * tests: update tests * chore: generate sync code * feat: add support for upsert * Rm cast from rpc in async client * Rm cast from rpc in sync client * Add table method as an alias for from_ Co-authored-by: dreinon <67071425+dreinon@users.noreply.github.com> Co-authored-by: Dani Reinón <dani@dribo.es>
- Loading branch information
1 parent
3934fb2
commit 315f596
Showing
13 changed files
with
692 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,6 @@ dmypy.json | |
|
||
# PyCharm | ||
.idea/ | ||
|
||
# Visual Studio Code | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,52 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-added-large-files | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: ["--fix=lf"] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-added-large-files | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: ["--fix=lf"] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-isort | ||
rev: v5.8.0 | ||
hooks: | ||
- id: isort | ||
args: | ||
[ | ||
"--multi-line=3", | ||
"--trailing-comma", | ||
"--force-grid-wrap=0", | ||
"--use-parentheses", | ||
"--line-width=88", | ||
] | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
args: | ||
[ | ||
"--profile", | ||
"black", | ||
"--multi-line=3", | ||
"--trailing-comma", | ||
"--force-grid-wrap=0", | ||
"--use-parentheses", | ||
"--line-width=88", | ||
] | ||
|
||
- repo: https://github.com/humitos/mirrors-autoflake.git | ||
rev: v1.1 | ||
hooks: | ||
- id: autoflake | ||
args: ["--in-place", "--remove-all-unused-imports"] | ||
- repo: https://github.com/myint/autoflake.git | ||
rev: v1.4 | ||
hooks: | ||
- id: autoflake | ||
args: | ||
[ | ||
"--in-place", | ||
"--remove-all-unused-imports", | ||
"--ignore-init-module-imports", | ||
] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 21.9b0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.4.1 | ||
hooks: | ||
- id: prettier | ||
- repo: https://github.com/ambv/black | ||
rev: 21.11b1 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.29.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: ["--py37-plus", "--keep-runtime-typing"] | ||
|
||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v2.20.0 | ||
hooks: | ||
- id: commitizen | ||
stages: [commit-msg] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
from postgrest_py._async.client import AsyncPostgrestClient # noqa: F401 | ||
from postgrest_py._async.request_builder import AsyncFilterRequestBuilder # noqa: F401 | ||
from postgrest_py._async.request_builder import AsyncQueryRequestBuilder # noqa: F401 | ||
from postgrest_py._async.request_builder import AsyncRequestBuilder # noqa: F401 | ||
from postgrest_py._async.request_builder import AsyncSelectRequestBuilder # noqa: F401 | ||
from postgrest_py._sync.client import SyncPostgrestClient # noqa: F401 | ||
from postgrest_py._sync.request_builder import SyncFilterRequestBuilder # noqa: F401 | ||
from postgrest_py._sync.request_builder import SyncQueryRequestBuilder # noqa: F401 | ||
from postgrest_py._sync.request_builder import SyncRequestBuilder # noqa: F401 | ||
from postgrest_py._sync.request_builder import SyncSelectRequestBuilder # noqa: F401 | ||
from postgrest_py.config import DEFAULT_POSTGREST_CLIENT_HEADERS # noqa: F401 | ||
from postgrest_py.deprecated_client import Client, PostgrestClient # noqa: F401 | ||
from postgrest_py.deprecated_get_request_builder import GetRequestBuilder # noqa: F401 | ||
from postgrest_py._async.client import AsyncPostgrestClient | ||
from postgrest_py._async.request_builder import ( | ||
AsyncFilterRequestBuilder, | ||
AsyncQueryRequestBuilder, | ||
AsyncRequestBuilder, | ||
AsyncSelectRequestBuilder, | ||
) | ||
from postgrest_py._sync.client import SyncPostgrestClient | ||
from postgrest_py._sync.request_builder import ( | ||
SyncFilterRequestBuilder, | ||
SyncQueryRequestBuilder, | ||
SyncRequestBuilder, | ||
SyncSelectRequestBuilder, | ||
) | ||
from postgrest_py.base_client import DEFAULT_POSTGREST_CLIENT_HEADERS | ||
from postgrest_py.deprecated_client import Client, PostgrestClient | ||
from postgrest_py.deprecated_get_request_builder import GetRequestBuilder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.