Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Allow unknown fields in DataSetConfig
Browse files Browse the repository at this point in the history
Before this change, adding a field to the data set config in stagecraft
before backdrop would cause backdrop to fail.
  • Loading branch information
robyoung committed Jun 13, 2014
1 parent 44cf209 commit 7b1d2b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backdrop/core/data_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __new__(cls, name, data_group, data_type, raw_queries_allowed=False,
bearer_token=None, upload_format="csv", upload_filters=None,
auto_ids=None, queryable=True, realtime=False,
capped_size=5040, max_age_expected=2678400,
published=True):
published=True, **kwargs):
if not data_set_is_valid(name):
raise ValueError("DataSet name is not valid: '{}'".format(name))

Expand Down
3 changes: 3 additions & 0 deletions tests/core/test_data_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ def test_creating_a_data_set_config_with_raw_queries_allowed(self):
data_set_config = DataSetConfig("name", data_group="group", data_type="type", raw_queries_allowed=True)
assert_that(data_set_config.raw_queries_allowed, is_(True))

def test_unknown_fields_do_not_cause_data_set_config_to_fail(self):
DataSetConfig('name', data_group='group', data_type='type', unknown=True)

def test_default_values(self):
data_set = DataSetConfig("default", data_group="with_defaults", data_type="def_type")

Expand Down

0 comments on commit 7b1d2b6

Please sign in to comment.