Skip to content

Commit b5b3b7d

Browse files
committed
fixes lint
1 parent 9726fa9 commit b5b3b7d

File tree

5 files changed

+24
-23
lines changed

5 files changed

+24
-23
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ format:
6868

6969
lint-snippets:
7070
cd docs/tools && uv run python check_embedded_snippets.py full
71-
72-
lint-and-test-snippets: lint-snippets
73-
# TODO: re-enable transformation snippets tests
71+
# TODO: re-enable transformation snippets tests when dlthub dep is available
7472
uv pip install docstring_parser_fork --reinstall
75-
uv run mypy --config-file mypy.ini docs/website docs/tools --exclude docs/tools/lint_setup --exclude docs/website/docs_processed --exclude docs/website/versioned_docs/ --exclude docs/website/docs/general-usage/transformations/transformation-snippets.py
73+
uv run mypy --config-file mypy.ini docs/website docs/tools --exclude docs/tools/lint_setup --exclude docs/website/docs_processed --exclude docs/website/versioned_docs/
7674
uv run ruff check
77-
uv run flake8 --max-line-length=200 docs/website docs/tools --exclude docs/website/.dlt-repo --exclude docs/website/docs/hub/features/transformations/transformation-snippets.py
75+
uv run flake8 --max-line-length=200 docs/website docs/tools --exclude docs/website/.dlt-repo
76+
77+
lint-and-test-snippets: lint-snippets
7878
cd docs/website/docs && uv run pytest --ignore=node_modules --ignore hub/features/transformations/transformation-snippets.py
7979

8080
lint-and-test-examples:

docs/website/docs/hub/features/project/python-api.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ Here are a few examples of what you can access from the project object:
3737
import dlt
3838

3939
# show the currently active profile
40-
print(dlt.hub.current.project.config().current_profile)
40+
# TODO: remove ignore when dlthub plugin releases
41+
print(dlt.hub.current.project.config().current_profile) # type: ignore
4142
# show the main project dir
42-
print(dlt.hub.current.project.config().project_dir)
43+
print(dlt.hub.current.project.config().project_dir) # type: ignore
4344
# show the project config dict
44-
print(dlt.hub.current.project.project().config)
45+
print(dlt.hub.current.project.project().config) # type: ignore
4546
# list explicitly defined datasets (also works with destinations, sources, pipelines, etc.)
46-
print(dlt.hub.current.project.project().datasets)
47+
print(dlt.hub.current.project.project().datasets) # type: ignore
4748
```
4849
## Accessing entities
4950

@@ -52,7 +53,7 @@ If allowed, implicit entities will be created and returned automatically. If not
5253
```py
5354
import dlt
5455

55-
entities = dlt.hub.current.project.entities()
56+
entities = dlt.hub.current.project.entities() # type: ignore
5657
pipeline = entities.get_pipeline("my_pipeline")
5758
destination = entities.get_destination("duckdb")
5859
transformation = entities.get_transformation("stressed_transformation")
@@ -69,7 +70,7 @@ You can also use it directly in your code through the project context:
6970
import dlt
7071

7172
# get the runner
72-
runner = dlt.hub.current.project.runner()
73+
runner = dlt.hub.current.project.runner() # type: ignore
7374
# run the "my_pipeline" pipeline from the currently active project
7475
runner.run_pipeline("my_pipeline")
7576
```
@@ -83,7 +84,7 @@ import dlt
8384

8485
# Get a dataset instance pointing to the default destination (first in dataset destinations list) and access data inside of it
8586
# Note: The dataset must already exist physically for this to work
86-
dataset = dlt.hub.current.project.catalog().dataset("my_pipeline_dataset")
87+
dataset = dlt.hub.current.project.catalog().dataset("my_pipeline_dataset") # type: ignore
8788
# Get the row counts of all tables in the dataset as a dataframe
8889
print(dataset.row_counts().df())
8990
```
@@ -109,7 +110,7 @@ import pandas as pd
109110
import dlt
110111

111112
# Get a dataset from the catalog (it must already exist and be defined in dlt.yml)
112-
dataset = dlt.hub.current.project.catalog().dataset("my_pipeline_dataset")
113+
dataset = dlt.hub.current.project.catalog().dataset("my_pipeline_dataset") # type: ignore
113114
# Write a DataFrame to the "my_table" table in the dataset
114115
dataset.save(pd.DataFrame({"name": ["John", "Jane", "Jim"], "age": [30, 25, 35]}), table_name="my_table")
115116
```
@@ -120,7 +121,7 @@ You can also read from an existing table and write the data to a new table, eith
120121
import dlt
121122

122123
# Get dataset from the catalog
123-
dataset = dlt.hub.current.project.catalog().dataset("my_pipeline_dataset")
124+
dataset = dlt.hub.current.project.catalog().dataset("my_pipeline_dataset") # type: ignore
124125

125126
# This function reads data in chunks from an existing table and yields each chunk
126127
def transform_frames():
@@ -141,14 +142,14 @@ You can switch to a different profile using the `switch_profile` function.
141142
Here’s an example:
142143

143144
```py
144-
from dlt.hub.current import project
145+
from dlt.hub.current import project # type: ignore
145146

146147

147148
if __name__ == "__main__":
148149
# Shows the current active profile
149150
print(project.config().current_profile)
150151
# Switch to the tests profile
151-
.context().switch_profile("tests")
152+
project.context().switch_profile("tests")
152153
# Now "tests" is the active profile, merged with the project config
153154
print(project.config().current_profile)
154155
```

docs/website/docs/hub/features/transformations/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import Admonition from "@theme/Admonition";
1010
<Admonition type="note" title={<span style={{ textTransform: "lowercase" }}>dltHub</span>}>
1111
<p>
1212
Transformations are part of **dltHub**. This module is currently available in 🧪 preview to selected users and projects.
13-
Contact us to get your [trial license](EULA)
13+
Contact us to get your [trial license](../../EULA.md)
1414
<br/>
15-
<em>[Copyright © 2025 dltHub Inc. All rights reserved.](EULA)</em>
15+
<em>[Copyright © 2025 dltHub Inc. All rights reserved.](../../EULA.md)</em>
1616
</p>
1717
</Admonition>
1818

docs/website/docs/hub/getting-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ You can verify that the license was installed correctly and is valid by running:
162162
$ dlt license show
163163
```
164164

165-
Our license terms can be found [here](EULA).
165+
Our license terms can be found [here](../EULA.md).

tests/hub/test_project.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ def test_imports() -> None:
66

77

88
def test_project_context() -> None:
9-
context = dlt.hub.current.project.context()
9+
context = dlt.hub.current.project.context() # type: ignore[attr-defined,unused-ignore]
1010
assert context.name == "hub"
11-
assert dlt.hub.current.project.catalog() is not None
12-
assert dlt.hub.current.project.config().name == "hub"
11+
assert dlt.hub.current.project.catalog() is not None # type: ignore[attr-defined,unused-ignore]
12+
assert dlt.hub.current.project.config().name == "hub" # type: ignore[attr-defined,unused-ignore]
1313

1414

1515
def test_switch_profile() -> None:
16-
from dlt.hub.current import project
16+
from dlt.hub.current import project # type: ignore[attr-defined,unused-ignore]
1717

1818
ctx = project.context()
1919
try:

0 commit comments

Comments
 (0)