Skip to content

Commit a19d3fd

Browse files
author
Lorena Bălan
committed
Merge branch 'main' into feat/singleton-connection
Signed-off-by: lorenabalan <lorena.balan@quantumblack.com>
2 parents fef275d + 86377e5 commit a19d3fd

File tree

7 files changed

+58
-4
lines changed

7 files changed

+58
-4
lines changed

.github/dco.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require:
2+
members: false

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,9 @@ uninstall-pre-commit:
5555

5656
print-python-env:
5757
@./tools/print_env.sh
58+
59+
sign-off:
60+
echo "git interpret-trailers --if-exists doNothing \c" >> .git/hooks/commit-msg
61+
echo '--trailer "Signed-off-by: $$(git config user.name) <$$(git config user.email)>" \c' >> .git/hooks/commit-msg
62+
echo '--in-place "$$1"' >> .git/hooks/commit-msg
63+
chmod +x .git/hooks/commit-msg

docs/source/05_data/01_data_catalog.md

+21
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,27 @@ dev_abs:
313313
account_name: accountname
314314
account_key: key
315315
```
316+
Example 16: Loading a CSV file stored in a remote location through SSH
317+
318+
```eval_rst
319+
.. note:: This example requires [Paramiko](https://www.paramiko.org) to be installed (`pip install paramiko`).
320+
```
321+
```yaml
322+
cool_dataset:
323+
type: pandas.CSVDataSet
324+
filepath: "sftp:///path/to/remote_cluster/cool_data.csv"
325+
credentials: cluster_credentials
326+
```
327+
All parameters required to establish the SFTP connection can be defined through `fs_args` or in `credentials.yml` as follows:
328+
329+
```yaml
330+
cluster_credentials:
331+
username: my_username
332+
host: host_address
333+
port: 22
334+
password: password
335+
```
336+
The list of all available parameters is given in the [Paramiko documentation](https://docs.paramiko.org/en/2.4/api/client.html#paramiko.client.SSHClient.connect).
316337

317338
## Creating a Data Catalog YAML configuration file via CLI
318339

docs/source/08_logging/01_logging.md

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ log.warning("Issue warning")
1818
log.info("Send information")
1919
```
2020

21+
```eval_rst
22+
.. note:: The name of a logger corresponds to a key in the ``loggers`` section in ``logging.yml`` (e.g. ``kedro.io``). See `Python's logging documentation <https://docs.python.org/3/library/logging.html#logger-objects>`_ for more information.
23+
```
24+
2125
## Logging for `anyconfig`
2226

2327
By default, [anyconfig](https://github.com/ssato/python-anyconfig) library that is used by `kedro` to read configuration files emits a log message with `INFO` level on every read. To reduce the amount of logs being sent for CLI calls, default project logging configuration in `conf/base/logging.yml` sets the level for `anyconfig` logger to `WARNING`.

docs/source/14_contribution/02_developer_contributor_guidelines.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ The sign-off can be added automatically to your commit message using the `-s` op
180180
git commit -s -m "This is my commit message"
181181
```
182182

183-
To avoid needing to remember the `-s` flag on every commit, you might like to set up an [alias](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases) for `git commit -s`.
183+
To avoid needing to remember the `-s` flag on every commit, you might like to set up an [alias](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases) for `git commit -s`. Alternatively, run `make sign-off` to setup a [`commit-msg` Git hook](https://git-scm.com/docs/githooks#_commit_msg) that automatically signs off all commits (including merge commits) you make while working on the Kedro repository.
184184

185185
If your PR is blocked due to unsigned commits then you will need to follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.
186186

kedro/extras/datasets/json/json_dataset.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,28 @@ class JSONDataSet(AbstractVersionedDataSet):
2121
"""``JSONDataSet`` loads/saves data from/to a JSON file using an underlying
2222
filesystem (e.g.: local, S3, GCS). It uses native json to handle the JSON file.
2323
24-
Example:
24+
Example adding a catalog entry with
25+
`YAML API <https://kedro.readthedocs.io/en/stable/05_data/\
26+
01_data_catalog.html#using-the-data-catalog-with-the-yaml-api>`_:
27+
28+
.. code-block:: yaml
29+
30+
>>> json_dataset:
31+
>>> type: json.JSONDataSet
32+
>>> filepath: data/01_raw/location.json
33+
>>> load_args:
34+
>>> lines: True
35+
>>>
36+
>>> cars:
37+
>>> type: json.JSONDataSet
38+
>>> filepath: gcs://your_bucket/cars.json
39+
>>> fs_args:
40+
>>> project: my-project
41+
>>> credentials: my_gcp_credentials
42+
>>> load_args:
43+
>>> lines: True
44+
45+
Example using Python API:
2546
::
2647
2748
>>> from kedro.extras.datasets.json import JSONDataSet

kedro/runner/parallel_runner.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def _validate_nodes(cls, nodes: Iterable[Node]):
187187
f"In order to utilize multiprocessing you need to make sure all nodes "
188188
f"are serializable, i.e. nodes should not include lambda "
189189
f"functions, nested functions, closures, etc.\nIf you "
190-
f"are using custom decorators ensure they are correctly using "
190+
f"are using custom decorators ensure they are correctly decorated using "
191191
f"functools.wraps()."
192192
)
193193

@@ -217,7 +217,7 @@ def _validate_catalog(cls, catalog: DataCatalog, pipeline: Pipeline):
217217
f"need to make sure all data sets are serializable, i.e. data sets "
218218
f"should not make use of lambda functions, nested functions, closures "
219219
f"etc.\nIf you are using custom decorators ensure they are correctly "
220-
f"using functools.wraps()."
220+
f"decorated using functools.wraps()."
221221
)
222222

223223
memory_data_sets = []

0 commit comments

Comments
 (0)