Skip to content

Commit

Permalink
Move DataApi import to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-balachander committed Aug 20, 2024
1 parent a8b1aed commit 720d484
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pydantic import Field, validator

from cumulusci.core.enums import StrEnum
from cumulusci.tasks.bulkdata.utils import DataApi
from cumulusci.utils.yaml.model_parser import CCIDictModel, HashableBaseModel

object_decl = re.compile(r"objects\((\w+)\)", re.IGNORECASE)
Expand All @@ -24,14 +25,6 @@ class SFFieldGroupTypes(StrEnum):
required = "required"


class DataApi(StrEnum):
"""Enum defining requested Salesforce data API for an operation."""

BULK = "bulk"
REST = "rest"
SMART = "smart"


class ExtractDeclaration(HashableBaseModel):
where: T.Optional[str] = None
fields_: T.Union[T.List[str], str] = Field(["FIELDS(ALL)"], alias="fields")
Expand Down
10 changes: 1 addition & 9 deletions cumulusci/tasks/bulkdata/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
random_generate_query,
random_post_process,
)
from cumulusci.tasks.bulkdata.utils import iterate_in_chunks
from cumulusci.tasks.bulkdata.utils import DataApi, iterate_in_chunks
from cumulusci.utils.classutils import namedtuple_as_simple_dict
from cumulusci.utils.xml import lxml_parse_string

Expand All @@ -45,14 +45,6 @@ class DataOperationType(StrEnum):
SELECT = "select"


class DataApi(StrEnum):
"""Enum defining requested Salesforce data API for an operation."""

BULK = "bulk"
REST = "rest"
SMART = "smart"


class DataOperationStatus(StrEnum):
"""Enum defining outcome values for a data operation."""

Expand Down
9 changes: 9 additions & 0 deletions cumulusci/tasks/bulkdata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@
from sqlalchemy.engine.base import Connection
from sqlalchemy.orm import Session, mapper

from cumulusci.core.enums import StrEnum
from cumulusci.core.exceptions import BulkDataException
from cumulusci.utils.iterators import iterate_in_chunks


class DataApi(StrEnum):
"""Enum defining requested Salesforce data API for an operation."""

BULK = "bulk"
REST = "rest"
SMART = "smart"


class SqlAlchemyMixin:
logger: logging.Logger
metadata: MetaData
Expand Down

0 comments on commit 720d484

Please sign in to comment.