Skip to content

Commit

Permalink
chore: Enable type checking in meltano.core.state_service (meltano#…
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Dec 21, 2022
1 parent 1fec4b6 commit 742d088
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,6 @@ module = [
"meltano.core.settings_service",
"meltano.core.settings_store",
"meltano.core.sqlalchemy",
"meltano.core.state_service",
"meltano.core.task_sets",
"meltano.core.task_sets_service",
"meltano.core.transform_add_service",
Expand Down
3 changes: 2 additions & 1 deletion src/meltano/core/job/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from contextlib import asynccontextmanager, contextmanager, suppress
from datetime import datetime, timedelta
from enum import Enum
from enum import IntFlag as EnumIntFlag

from sqlalchemy import Column, literal, types
from sqlalchemy.ext.hybrid import Comparator, hybrid_property
Expand Down Expand Up @@ -80,7 +81,7 @@ def current_trigger():
return os.getenv("MELTANO_JOB_TRIGGER")


class Payload(IntFlag):
class Payload(EnumIntFlag):
"""Flag indicating whether a Job has state in its payload field."""

STATE = 1
Expand Down
4 changes: 2 additions & 2 deletions src/meltano/core/state_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def validate_state(state: dict[str, Any]):
def add_state(
self,
job: Job | str,
new_state: str | None,
new_state: str,
payload_flags: Payload = Payload.STATE,
validate=True,
):
Expand Down Expand Up @@ -157,7 +157,7 @@ def get_state(self, state_id: str):
return json.loads(state.json_merged())
return {}

def set_state(self, state_id: str, new_state: str | None, validate: bool = True):
def set_state(self, state_id: str, new_state: str, validate: bool = True):
"""Set the state for the state_id.
Args:
Expand Down

0 comments on commit 742d088

Please sign in to comment.