Skip to content

Commit 31c11dd

Browse files
committedMar 3, 2023
add pre-commit with basic hooks
1 parent e154a75 commit 31c11dd

File tree

16 files changed

+29
-18
lines changed

16 files changed

+29
-18
lines changed
 

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,4 @@ dmypy.json
123123
.pyre/
124124

125125
# Editors/IDEs
126-
/.idea/
126+
/.idea/

‎.pre-commit-config.yaml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.2.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-toml
10+
- id: check-yaml
11+
- id: check-added-large-files

‎LICENSE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1616
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19-
SOFTWARE.
19+
SOFTWARE.

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ clean:
3030
mkdir -p .venv
3131
cd .venv && $(.PYTHON3) -m venv --copies --prompt='[$(shell basename `pwd`)/.venv]' .
3232

33-
.venv/bin/python -m pip install --upgrade pip
33+
.venv/bin/python -m pip install --upgrade pip

‎docs/api.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ Superset API Client
2929

3030
.. autoclass:: SupersetClient
3131
:members:
32-
:inherited-members:
32+
:inherited-members:

‎docs/changes.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.. include:: ../CHANGELOG.rst
1+
.. include:: ../CHANGELOG.rst

‎docs/config.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ and can be changed with the `monkey patch`_ from `Mara App`_. An example can be
6161
.. py:data:: superset_data_db_schema
6262
6363
The name of the schema where the flattered data sets for Superset are stored
64-
64+
6565
Default: ``'superset'``
6666

6767
.. py:data:: metadata_update_strategy

‎docs/index.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ Legal information and changelog are here for the interested.
4949
:maxdepth: 2
5050

5151
license
52-
changes
52+
changes

‎docs/sync.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ The update strategy is defined via an flag Enum ``UpdateStrategy`` which support
1616
When the model does not exist in Superset, create it
1717

1818
.. py:data:: UPDATE
19-
19+
2020
When the model exists already in Superset, update its columns. Columns which where removed will be retained and return a 'NULL' value.
21-
21+
2222
.. warning::
2323
New columns are (currently) not added automatically. You need to run schema sync. manually in Superset and then run the metadata sync again.
2424
This might drop columns which does not exist anymore leaving existing charts in an inconsistent state (!).

‎mara_superset/.scripts/superset.mk‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ install-superset:
3838
# remove virtual env for superset
3939
.cleanup-superset:
4040
rm -rf .superset
41-
rm -f .venv/bin/superset
41+
rm -f .venv/bin/superset

‎mara_superset/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ def MARA_ACL_RESOURCES():
1818

1919
def MARA_NAVIGATION_ENTRIES():
2020
from . import views
21-
return {'Superset': views.navigation_entry()}
21+
return {'Superset': views.navigation_entry()}

‎mara_superset/cli.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
def update_metadata():
66
"""Sync schema definitions from Mara to Superset"""
77
from . import metadata
8-
metadata.update_metadata()
8+
metadata.update_metadata()

‎mara_superset/client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class SupersetClient(object):
88
"""
99
A client class for interacting with the Superset API
10-
10+
1111
See also: https://superset.apache.org/docs/api
1212
"""
1313
def __init__(self):
@@ -65,4 +65,4 @@ def put(self, path, data=None) -> dict:
6565
return self.request(self.session.put, path, data)
6666

6767
def delete(self, path, data=None) -> dict:
68-
return self.request(self.session.delete, path, data)
68+
return self.request(self.session.delete, path, data)

‎mara_superset/metadata.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class UpdateStrategy(Flag):
3636
def update_metadata(update_strategy: UpdateStrategy = None) -> bool:
3737
"""
3838
Updates descriptions of tables & fields in Superset, creates metrics and flushes field caches
39-
39+
4040
Args:
4141
update_strategy: How the metadata should be updated. If not defined the value from config.metadata_update_strategy().
4242
"""
@@ -179,7 +179,7 @@ def delete_dataset_metadata(data_set_id):
179179
update_dataset_metadata(data_set, data_set_id=data_set_id)
180180

181181
# removes the entity from the dict so we leave at the end only the
182-
# data sets in the dict which are not
182+
# data sets in the dict which are not
183183
del data_sets[data_set_metadata['table_name']]
184184
elif bool(update_strategy & UpdateStrategy.DELETE):
185185
if not data_set.get('is_sqllab_view',False):

‎mara_superset/views.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ def navigation_entry():
1919
def superset():
2020
from . import config
2121

22-
return flask.redirect(config.external_superset_url())
22+
return flask.redirect(config.external_superset_url())

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from setuptools import setup
22

3-
setup()
3+
setup()

0 commit comments

Comments
 (0)
Please sign in to comment.