Skip to content

Commit

Permalink
Support cloud shell (#780)
Browse files Browse the repository at this point in the history
* make dftw Cloud shell compatible
* Allow python 3.9 usage
* Update pytype version

* Adapt type checks to work with python 3.9
  • Loading branch information
jkppr authored Sep 21, 2023
1 parent a8eaba4 commit 58e2574
Show file tree
Hide file tree
Showing 3 changed files with 863 additions and 752 deletions.
8 changes: 4 additions & 4 deletions dftimewolf/lib/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import datetime
from dataclasses import dataclass
import logging
from typing import Dict, Any, List, Union
from typing import Dict, Any, List, Union, Optional
import uuid as uuid_lib

from dftimewolf import config
Expand Down Expand Up @@ -38,7 +38,7 @@ class TelemetryCollection:
class BaseTelemetry():
"""Interface for implementing a telemetry module."""

def __init__(self, uuid: str | None = None) -> None:
def __init__(self, uuid: Optional[str] = None) -> None:
"""Initializes a BaseTelemetry object."""
super().__init__()
self.uuid = uuid
Expand Down Expand Up @@ -77,7 +77,7 @@ def __init__(
project_name: str,
instance_name: str,
database_name: str,
uuid: str | None = None) -> None:
uuid: Optional[str] = None) -> None:
"""Initializes a GoogleCloudSpannerTelemetry object."""
super().__init__(uuid=uuid)
self.project_name = project_name
Expand Down Expand Up @@ -163,7 +163,7 @@ def _LogTelemetryTransaction(


def GetTelemetry(
uuid: str | None = None
uuid: Optional[str] = None
) -> Union[BaseTelemetry, GoogleCloudSpannerTelemetry]:
"""Returns the currently configured Telemetry object."""
telemetry_config = config.Config.GetExtra('telemetry')
Expand Down
Loading

0 comments on commit 58e2574

Please sign in to comment.