Skip to content

Commit

Permalink
Merge branch 'master' into spencerpearson/no-retry-conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
speezepearson committed Sep 22, 2022
2 parents 2e43a1d + 06c6e6d commit 316a38a
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 4 deletions.
17 changes: 15 additions & 2 deletions wandb/apis/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@
import urllib
from collections import namedtuple
from functools import partial
from typing import Any, Dict, List, Mapping, MutableMapping, Optional, Sequence
from typing import (
TYPE_CHECKING,
Any,
Dict,
List,
Mapping,
MutableMapping,
Optional,
Sequence,
)

import requests
from wandb_gql import Client, gql
Expand All @@ -44,6 +53,10 @@
from wandb.sdk.lib import ipython, retry
from wandb.sdk.wandb_require_helpers import requires

if TYPE_CHECKING:
import wandb.apis.reports
import wandb.apis.reports.util

logger = logging.getLogger(__name__)

# Only retry requests for 20 seconds in the public api
Expand Down Expand Up @@ -409,7 +422,7 @@ def create_report(
title: Optional[str] = "Untitled Report",
description: Optional[str] = "",
width: Optional[str] = "readable",
blocks: "Optional[wandb.apis.reports.Block]" = None,
blocks: "Optional[wandb.apis.reports.util.Block]" = None,
) -> "wandb.apis.reports.Report":
if entity == "":
entity = self.default_entity or ""
Expand Down
5 changes: 4 additions & 1 deletion wandb/apis/reports/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
import urllib
from copy import deepcopy
from typing import Any, Dict
from typing import TYPE_CHECKING, Any, Dict
from typing import List as LList
from typing import Optional, Union

Expand Down Expand Up @@ -37,6 +37,9 @@
TypeValidator,
)

if TYPE_CHECKING:
import wandb.apis.public


class LineKey:
def __init__(self, key: str) -> None:
Expand Down
16 changes: 15 additions & 1 deletion wandb/apis/reports/util.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
from typing import Any, Dict, List, Optional, Tuple, TypeVar, Union, get_type_hints
from typing import (
TYPE_CHECKING,
Any,
Dict,
List,
Optional,
Tuple,
TypeVar,
Union,
get_type_hints,
)

import wandb
from wandb.sdk.wandb_require_helpers import RequiresReportEditingMixin

from .validators import UNDEFINED_TYPE, TypeValidator, Validator

if TYPE_CHECKING:
import wandb.apis.reports.reports


Func = TypeVar("Func")
T = TypeVar("T")
V = TypeVar("V")
Expand Down
3 changes: 3 additions & 0 deletions wandb/sdk/internal/internal_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
else:
from typing_extensions import Literal, Protocol, TypedDict

import wandb.sdk.internal.settings_static
import wandb.sdk.wandb_settings

from .progress import ProgressFn

class CreateArtifactFileSpecInput(TypedDict, total=False):
Expand Down
4 changes: 4 additions & 0 deletions wandb/sdk/wandb_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
else:
from typing_extensions import TypedDict

import wandb.apis.public
import wandb.sdk.backend.backend
import wandb.sdk.interface.interface_grpc
import wandb.sdk.interface.interface_queue
from wandb.proto.wandb_internal_pb2 import (
CheckVersionResponse,
GetSummaryResponse,
Expand Down
7 changes: 7 additions & 0 deletions wandb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from types import ModuleType, TracebackType
from typing import (
IO,
TYPE_CHECKING,
Any,
Callable,
Dict,
Expand All @@ -58,6 +59,12 @@
from wandb.env import SENTRY_DSN, error_reporting_enabled, get_app_url
from wandb.errors import CommError, UsageError, term

if TYPE_CHECKING:
import wandb.apis.public
import wandb.sdk.internal.settings_static
import wandb.sdk.wandb_artifacts
import wandb.sdk.wandb_settings

CheckRetryFnType = Callable[[Exception], Union[bool, timedelta]]

logger = logging.getLogger(__name__)
Expand Down

0 comments on commit 316a38a

Please sign in to comment.