How to use the databand.parameters.DateMinuteParameter function in databand

To help you get started, we’ve selected a few databand examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github databand-ai / dbnd / modules / dbnd / test_dbnd / parameters / test_date_parameter.py View on Github external
from dbnd import parameter
from dbnd._core.utils.timezone import utc
from dbnd.testing.helpers import build_task
from dbnd_test_scenarios.test_common.task.factories import TTask


class DateTask(TTask):
    day = parameter[datetime.date]


class DateHourTask(TTask):
    dh = parameters.DateHourParameter()


class DateMinuteTask(TTask):
    dm = parameters.DateMinuteParameter()


class DateSecondTask(TTask):
    ds = parameters.DateSecondParameter()


class MonthTask(TTask):
    month = MonthParameter()


class YearTask(TTask):
    year = YearParameter()


class TestDateParameter(object):
    def test_parse(self):
github databand-ai / dbnd / modules / dbnd / test_dbnd / parameters / test_date_parameter.py View on Github external
def test_serialize(self):
        dm = parameters.DateMinuteParameter()._p.to_str(
            datetime.datetime(2013, 2, 1, 18, 42, 0)
        )
        assert dm == "2013-02-01T1842"
github databand-ai / dbnd / modules / dbnd / test_dbnd / parameters / test_date_parameter.py View on Github external
def test_parse_padding_zero(self):
        dm = parameters.DateMinuteParameter()._p.parse_from_str("2013-02-01T1807")
        assert dm == datetime.datetime(2013, 2, 1, 18, 7, 0, tzinfo=utc)
github databand-ai / dbnd / modules / dbnd / test_dbnd / package / test_import_package.py View on Github external
# These should exist (if not, this will cause AttributeErrors)
        expected = [
            dbnd.Config,
            dbnd.Task,
            dbnd.output,
            dbnd.parameter,
            dbnd.data,
            databand.task,
            tasks.DataSourceTask,
            tasks.PipelineTask,
            targets.Target,
            targets.DataTarget,
            dbnd._core.task_build.task_namespace.namespace,
            parameters.Parameter,
            parameters.DateHourParameter,
            parameters.DateMinuteParameter,
            parameters.DateSecondParameter,
            parameters.DateParameter,
            parameters.MonthParameter,
            parameters.YearParameter,
            parameters.DateIntervalParameter,
            parameters.TimeDeltaParameter,
            parameters.IntParameter,
            parameters.FloatParameter,
            parameters.BoolParameter,
        ]
        assert len(expected) > 0
github databand-ai / dbnd / modules / dbnd / test_dbnd / parameters / test_date_parameter.py View on Github external
def test_serialize_padding_zero(self):
        dm = parameters.DateMinuteParameter()._p.to_str(
            datetime.datetime(2013, 2, 1, 18, 7, 0)
        )
        assert dm == "2013-02-01T1807"
github databand-ai / dbnd / modules / dbnd / test_dbnd / parameters / test_date_parameter.py View on Github external
def test_parse(self):
        dm = parameters.DateMinuteParameter()._p.parse_from_str("2013-02-01T1842")
        assert dm == datetime.datetime(2013, 2, 1, 18, 42, 0, tzinfo=utc)