Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ingest): handle when current server version is unavailable #5547

Merged
merged 4 commits into from
Aug 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions metadata-ingestion/src/datahub/upgrade/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async def get_server_config(gms_url: str, token: str) -> dict:

async def get_server_version_stats(
server: Optional[DataHubGraph] = None,
) -> Tuple[Any, Any, Any]:
) -> Tuple[Optional[str], Optional[Version], Optional[datetime]]:
server_config = None
if not server:
try:
Expand Down Expand Up @@ -180,15 +180,20 @@ async def retrieve_version_stats(
) = server_config_future.result()
tasks.remove(t)

server_version_stats = ServerVersionStats(
current=VersionStats(
version=current_server_version, release_date=current_server_release_date
),
latest=VersionStats(version=last_server_version, release_date=last_server_date)
if last_server_version
else None,
current_server_type=current_server_type,
)
server_version_stats = None
if current_server_version:
server_version_stats = ServerVersionStats(
current=VersionStats(
version=current_server_version, release_date=current_server_release_date
),
latest=VersionStats(
version=last_server_version, release_date=last_server_date
)
if last_server_version
else None,
current_server_type=current_server_type,
)

if client_version_stats and server_version_stats:
return DataHubVersionStats(
server=server_version_stats, client=client_version_stats
Expand Down