Skip to content

Commit

Permalink
feat: fix URLS (#38)
Browse files Browse the repository at this point in the history
* fix: url

* fix urls

* fix: url

* fix: url
  • Loading branch information
suryaiyer95 authored May 31, 2024
1 parent e81e71e commit 4c9ef97
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/datapilot/core/platforms/dbt/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from datapilot.core.platforms.dbt.utils import load_catalog
from datapilot.core.platforms.dbt.utils import load_manifest
from datapilot.utils.formatting.utils import tabulate_data
from datapilot.utils.utils import map_url_to_instance

logging.basicConfig(level=logging.INFO)

Expand Down Expand Up @@ -138,6 +139,11 @@ def onboard(

response = start_dbt_ingestion(token, instance_name, dbt_core_integration_id, dbt_core_integration_environment, backend_url)
if response["ok"]:
click.echo("Onboarding completed successfully!")
url = map_url_to_instance(backend_url, instance_name)
if not url:
click.echo("Manifest and catalog ingestion has started.")
else:
url = f"{url}/settings/integrations/{dbt_core_integration_id}/{dbt_core_integration_environment}"
click.echo(f"Manifest and catalog ingestion has started. You can check the status at {url}")
else:
click.echo(f"{response['message']}")
15 changes: 11 additions & 4 deletions src/datapilot/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,14 @@ def generate_partial_manifest_catalog(changed_files, base_path: str = "./"):
raise Exception("Unable to generate partial manifest and catalog") from e


if __name__ == "__main__":
print("Running main")
print(generate_partial_manifest_catalog([], "/Users/gaurp/Desktop/manifest.json", ""))
print("Done running main")
def map_url_to_instance(url, instance):
# Base URLs and their corresponding patterns
url_mapping = {
"https://api.tryaltimate.com": f"https://{instance}.demo.tryaltimate.com",
"https://api.myaltimate.com": f"https://{instance}.app.myaltimate.com",
"https://api.getaltimate.com": f"https://{instance}.app.getaltimate.com",
"http://localhost:8000": f"http://{instance}.localhost:3000",
}

# Check if the URL is in the dictionary and return the corresponding instance URL
return url_mapping.get(url)

0 comments on commit 4c9ef97

Please sign in to comment.