Skip to content

Commit 40e0f16

Browse files
committed
fix bing_webmaster test
1 parent 66cc156 commit 40e0f16

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

sources/asana_dlt/__init__.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ def workspaces(fields: Iterable[str] = WORKSPACE_FIELDS) -> Iterable[TDataItem]:
4747
Yields:
4848
dict: The workspace data.
4949
"""
50-
yield from get_client(access_token).workspaces.find_all(opt_fields=",".join(fields))
51-
50+
yield from get_client(access_token).workspaces.find_all(
51+
opt_fields=",".join(fields)
52+
)
5253

5354
@dlt.transformer(
5455
data_from=workspaces,
@@ -75,7 +76,6 @@ def projects(
7576
)
7677
)
7778

78-
7979
@dlt.transformer(
8080
data_from=projects,
8181
write_disposition="replace",
@@ -103,7 +103,6 @@ def sections(
103103
)
104104
]
105105

106-
107106
@dlt.transformer(data_from=workspaces, write_disposition="replace")
108107
@dlt.defer
109108
def tags(
@@ -127,7 +126,6 @@ def tags(
127126
)
128127
]
129128

130-
131129
@dlt.transformer(data_from=projects, write_disposition="merge", primary_key="gid")
132130
def tasks(
133131
project_array: t.List[TDataItem],
@@ -157,7 +155,6 @@ def tasks(
157155
)
158156
)
159157

160-
161158
@dlt.transformer(
162159
data_from=tasks,
163160
write_disposition="append",
@@ -184,7 +181,6 @@ def stories(
184181
)
185182
]
186183

187-
188184
@dlt.transformer(
189185
data_from=workspaces,
190186
write_disposition="replace",
@@ -211,7 +207,6 @@ def teams(
211207
)
212208
]
213209

214-
215210
@dlt.transformer(
216211
data_from=workspaces,
217212
write_disposition="replace",
@@ -249,4 +244,3 @@ def users(
249244
teams,
250245
users,
251246
]
252-

tests/bing_webmaster/test_bing_webmaster_source.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def _make_pipeline(destination_name: str) -> dlt.Pipeline:
1717
@pytest.mark.parametrize("destination_name", ["duckdb"])
1818
def test_load_unauthorized_domain(destination_name: str) -> None:
1919
pipeline = _make_pipeline(destination_name)
20-
data = source(site_urls=["wikipedia.org"])
20+
data = source(site_urls=["wikipedia.org"], site_url_pages=[])
2121
with pytest.raises(Exception):
2222
pipeline.run(data.with_resources("page_stats"))
2323

@@ -28,7 +28,7 @@ def test_load_page_stats(destination_name: str) -> None:
2828
table_name = "bing_page_stats"
2929

3030
# Note: If this test fails: replace this with a site_url you can access
31-
data = source(site_urls=["dlthub.com"])
31+
data = source(site_urls=["dlthub.com"], site_url_pages=[])
3232

3333
info = pipeline.run(data.with_resources("page_stats"))
3434
assert_load_info(info)
@@ -63,11 +63,12 @@ def test_load_page_query_stats(destination_name: str) -> None:
6363
table_name = "bing_page_query_stats"
6464

6565
data = source(
66+
site_urls=["dlthub.com"],
6667
# Note: If this test fails: replace this with site_url and pages you can access
6768
site_url_pages=[
6869
{"site_url": "dlthub.com", "page": "https://dlthub.com/docs/intro"},
6970
{"site_url": "dlthub.com", "page": "https://dlthub.com/why/"},
70-
]
71+
],
7172
)
7273
info = pipeline.run(data.with_resources("page_query_stats"))
7374
assert_load_info(info)

0 commit comments

Comments
 (0)