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

update source tiktok to support python 3.11 #39578

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
from abc import ABC, abstractmethod
from datetime import datetime
from decimal import Decimal
from enum import Enum
if sys.version_info >= (3, 11):
from enum import StrEnum
else:
from enum import Enum
from functools import total_ordering
from typing import Any, Dict, Iterable, List, Mapping, MutableMapping, Optional, Tuple, TypeVar, Union

Expand Down Expand Up @@ -141,21 +144,39 @@ def __lt__(self, other):
return self.current_stream_state < other


class ReportLevel(str, Enum):
ADVERTISER = "ADVERTISER"
CAMPAIGN = "CAMPAIGN"
ADGROUP = "ADGROUP"
AD = "AD"
if sys.version_info >= (3, 11):

class ReportLevel(StrEnum):
ADVERTISER = "ADVERTISER"
CAMPAIGN = "CAMPAIGN"
ADGROUP = "ADGROUP"
AD = "AD"

class ReportGranularity(str, Enum):
LIFETIME = "LIFETIME"
DAY = "DAY"
HOUR = "HOUR"
class ReportGranularity(StrEnum):
LIFETIME = "LIFETIME"
DAY = "DAY"
HOUR = "HOUR"

@classmethod
def default(cls):
return cls.DAY
@classmethod
def default(cls):
return cls.DAY

else:

class ReportLevel(str, Enum):
ADVERTISER = "ADVERTISER"
CAMPAIGN = "CAMPAIGN"
ADGROUP = "ADGROUP"
AD = "AD"

class ReportGranularity(str, Enum):
LIFETIME = "LIFETIME"
DAY = "DAY"
HOUR = "HOUR"

@classmethod
def default(cls):
return cls.DAY


class Hourly:
Expand Down
Loading