Skip to content

Commit 227b8c5

Browse files
authored
Make dtvals more intuitive (#58)
The default function ended up being a useless abstraction. Normal functions with decorators to avoid boilerplate makes for an easier module to use. The module functions are easier to discover because of auto complete.
1 parent e913055 commit 227b8c5

File tree

8 files changed

+282
-172
lines changed

8 files changed

+282
-172
lines changed

birgitta/schema/fixtures/values/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
def inthepast():
88
"""We have a hardcoded default timestamp to get consistent
99
test execution"""
10-
return dtvals.format_dt(pd.Timestamp(2019, 1, 1, 1))
10+
return dtvals.format_date(pd.Timestamp(2019, 1, 1, 1))
1111

1212

13-
def inthepast_str():
13+
def inthepaststr():
1414
return dtvals.dtstr(inthepast())
1515

1616

@@ -38,7 +38,7 @@ def year_end():
3838

3939
def today_datetime():
4040
"""Today is two months after default timestamp"""
41-
return dtvals.format_dt(pd.Timestamp(2019, 3, 1, 1))
41+
return dtvals.format_date(pd.Timestamp(2019, 3, 1, 1))
4242

4343

4444
def timestamp(day_delta=0, hour_delta=0, hard_val=None):
@@ -50,7 +50,7 @@ def timestamp(day_delta=0, hour_delta=0, hard_val=None):
5050
else:
5151
dt = default_timestamp() + pd.Timedelta(days=day_delta,
5252
hours=hour_delta)
53-
dt = dtvals.format_dt(dt)
53+
dt = dtvals.format_date(dt)
5454
return dt
5555

5656

0 commit comments

Comments
 (0)