refactor: textwrap.dedentを使って余分な半角スペースを消す

This commit is contained in:
shimoda.m@nds-tyo.co.jp 2022-08-17 10:59:47 +09:00
parent 2f230e2f15
commit f4b03c0c45

View File

@ -1,12 +1,15 @@
from src.config.objects import TargetObject, LastFetchDatetime
import textwrap
from src.config.objects import LastFetchDatetime, TargetObject
class SOQLBuilder:
def __init__(self, target_object: TargetObject, last_fetch_datetime: LastFetchDatetime) -> None:
self.__SELECT_SOQL = """SELECT {column_or_expression} FROM {object_name}
WHERE {datetime_column} > {last_fetch_datetime_from}
AND {datetime_column} <= {last_fetch_datetime_to}
"""
self.__SELECT_SOQL = textwrap.dedent("""\
SELECT {column_or_expression} FROM {object_name}
WHERE {datetime_column} > {last_fetch_datetime_from}
AND {datetime_column} <= {last_fetch_datetime_to}
""")
self.__target_object = target_object
self.__last_fetch_datetime = last_fetch_datetime