Skip to content

Commit

Permalink
fix(dbt Cloud): Including GraphQL path for custom endpints (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitor-Avila committed Jun 21, 2024
1 parent 7e3caac commit 149967a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/preset_cli/api/clients/dbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,12 @@ def get_custom_urls(access_url: Optional[str] = None) -> Dict[str, URL]:
),
"discovery": parsed.with_host(
f"{match['code']}.metadata.{match['region']}.dbt.com",
),
)
/ "graphql",
"semantic-layer": parsed.with_host(
f"{match['code']}.semantic-layer.{match['region']}.dbt.com",
),
)
/ "api/graphql",
}

raise Exception("Invalid host in custom URL")
Expand Down
4 changes: 2 additions & 2 deletions tests/api/clients/dbt_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1377,8 +1377,8 @@ def test_get_custom_urls() -> None:

assert get_custom_urls("https://ab123.us1.dbt.com") == {
"admin": URL("https://ab123.us1.dbt.com"),
"discovery": URL("https://ab123.metadata.us1.dbt.com"),
"semantic-layer": URL("https://ab123.semantic-layer.us1.dbt.com"),
"discovery": URL("https://ab123.metadata.us1.dbt.com/graphql"),
"semantic-layer": URL("https://ab123.semantic-layer.us1.dbt.com/api/graphql"),
}

with pytest.raises(Exception) as excinfo:
Expand Down

0 comments on commit 149967a

Please sign in to comment.