Skip to content

Commit

Permalink
Remove starred field everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
cmongut committed Apr 3, 2020
1 parent 12777ac commit 4d9ebb8
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def _map_row(self, row):
'id': self._normalize_field(row, self.id_field),
'slug': self._normalize_field(row, 'slug'),
'name': self._normalize_field(row, 'name'),
'dataset_id': self._normalize_field(row, 'dataset_id'),
'starred': self._normalize_field(row, 'starred')
'dataset_id': self._normalize_field(row, 'dataset_id')
}


Expand Down
5 changes: 0 additions & 5 deletions cartoframes/data/observatory/catalog/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ def variable_group(self):
"""If any, ID of the variable group to which this variable belongs."""
return self.data['variable_group_id']

@property
def starred(self):
"""Boolean indicating whether this variable is a starred one or not. Internal usage only"""
return self.data['starred']

@property
def summary(self):
"""JSON object with extra metadata that summarizes different properties of this variable."""
Expand Down
5 changes: 0 additions & 5 deletions cartoframes/data/observatory/catalog/variable_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,3 @@ def name(self):
def dataset(self):
"""ID of the dataset related to this variable group."""
return self.data['dataset_id']

@property
def starred(self):
"""Boolean indicating whether this variable group is a starred one or not.."""
return self.data['starred']
8 changes: 2 additions & 6 deletions tests/unit/data/observatory/catalog/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
'dataset_id': 'dataset1',
'agg_method': '',
'variable_group_id': 'vargroup1',
'starred': True,
'summary_json': None
}
db_variable2 = {
Expand All @@ -148,7 +147,6 @@
'dataset_id': 'dataset1',
'agg_method': '',
'variable_group_id': 'vargroup1',
'starred': False,
'summary_json': [{'key': 'value'}]
}
test_variable1 = Variable(db_variable1)
Expand All @@ -171,15 +169,13 @@
'id': 'carto-do.variable_group.vargroup1',
'slug': 'vargroup1',
'name': 'Population',
'dataset_id': 'dataset1',
'starred': True
'dataset_id': 'dataset1'
}
db_variable_group2 = {
'id': 'carto-do.variable_group.vargroup2',
'slug': 'vargroup2',
'name': 'Date',
'dataset_id': 'dataset1',
'starred': False
'dataset_id': 'dataset1'
}
test_variable_group1 = VariableGroup(db_variable_group1)
test_variable_group2 = VariableGroup(db_variable_group2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ def test_missing_fields_are_mapped_as_None(self, mocked_repo):
'id': 'variable_group1',
'slug': None,
'name': None,
'dataset_id': None,
'starred': None
'dataset_id': None
})])

# When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def test_missing_fields_are_mapped_as_None(self, mocked_repo):
'dataset_id': None,
'agg_method': None,
'variable_group_id': None,
'starred': None,
'summary_json': None
})])

Expand Down
2 changes: 0 additions & 2 deletions tests/unit/data/observatory/catalog/test_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def test_variable_properties(self):
dataset = variable.dataset
agg_method = variable.agg_method
variable_group = variable.variable_group
starred = variable.starred
summary = variable.summary

# Then
Expand All @@ -66,7 +65,6 @@ def test_variable_properties(self):
assert dataset == db_variable1['dataset_id']
assert agg_method == db_variable1['agg_method']
assert variable_group == db_variable1['variable_group_id']
assert starred == db_variable1['starred']
assert summary == db_variable1['summary_json']

def test_variable_is_exported_as_series(self):
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/data/observatory/catalog/test_variable_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ def test_variable_group_properties(self):
slug = variable_group.slug
name = variable_group.name
dataset = variable_group.dataset
starred = variable_group.starred

# Then
assert variable_group_id == db_variable_group1['id']
assert slug == db_variable_group1['slug']
assert name == db_variable_group1['name']
assert dataset == db_variable_group1['dataset_id']
assert starred == db_variable_group1['starred']

def test_variable_group_is_exported_as_series(self):
# Given
Expand Down

0 comments on commit 4d9ebb8

Please sign in to comment.