Skip to content

Commit

Permalink
v1.20.6 Improve date inferring
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Mar 12, 2024
1 parent c81eb66 commit db770c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tableschema/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.5
1.20.6
2 changes: 1 addition & 1 deletion tableschema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def __hash__(self):
'array',
'datetime',
'time',
('date', ('%Y-%m-%d', '%Y/%m/%d', '%d/%m/%Y', '%m/%d/%Y', '%Y%m%d', '%Y.%m.%d')),
('date', ('%Y-%m-%d', '%Y/%m/%d', '%d/%m/%Y', '%m/%d/%Y', '%Y%m%d', '%Y.%m.%d', '%y-%m-%d', '%y/%m/%d', '%d/%m/%y', '%m/%d/%y', '%y%m%d', '%y.%m.%d')),
'integer',
'number',
'boolean',
Expand Down
10 changes: 5 additions & 5 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ def test_save(tmpdir, apply_defaults):
def test_infer():
data = [
['id', 'age', 'name', 'dob'],
['1','39','Paul','28/1/1979'],
['2','23','Jimmy','13/6/1995'],
['3','36','Jane','17/9/1980'],
['4','N/A','Judy','19/4/1983'],
['1','39','Paul','28/1/79'],
['2','23','Jimmy','13/6/95'],
['3','36','Jane','17/9/80'],
['4','N/A','Judy','19/4/83'],
]
schema = Schema()
schema.infer(data)
Expand All @@ -322,7 +322,7 @@ def test_infer():
{'format': 'default', 'name': 'id', 'type': 'integer'},
{'format': 'default', 'name': 'age', 'type': 'integer'},
{'format': 'default', 'name': 'name', 'type': 'string'},
{'format': '%d/%m/%Y', 'name': 'dob', 'type': 'date'},
{'format': '%d/%m/%y', 'name': 'dob', 'type': 'date'},
],
'missingValues': ['']}
data = [
Expand Down

0 comments on commit db770c8

Please sign in to comment.