Skip to content

Commit

Permalink
Merge pull request #2 from selobu/2023oct0301
Browse files Browse the repository at this point in the history
refactor: ♻️ included walrus operator to simplify code
  • Loading branch information
selobu authored Oct 3, 2023
2 parents 9111bb4 + 22df1ea commit 4150b99
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/.pytest_cache
/.pytest_cache
**/__pycache__/
Binary file removed pyd_sqa/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file removed pyd_sqa/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file removed pyd_sqa/__pycache__/main.cpython-310.pyc
Binary file not shown.
Binary file removed pyd_sqa/__pycache__/main.cpython-39.pyc
Binary file not shown.
9 changes: 5 additions & 4 deletions pyd_sqa/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ def pyd_sqa(
mapper = inspect(db_model)
fields = {}
for attr in mapper.attrs:
if not isinstance(attr, ColumnProperty) or not attr.columns:
continue
name = attr.key
if name in exclude:
if (
not isinstance(attr, ColumnProperty)
or not attr.columns
or (name := attr.key) in exclude
):
continue
column = attr.columns[0]
python_type = None
Expand Down
Binary file removed tests/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file removed tests/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 4150b99

Please sign in to comment.