Skip to content

Commit f264dcd

Browse files
authored
Merge pull request #66 from keboola/fix/missing-column
Fix/missing column
2 parents 45fc673 + 7a6c756 commit f264dcd

4 files changed

Lines changed: 35 additions & 3 deletions

File tree

docs/dao.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2517,7 +2517,7 @@ <h2 id="args">Args</h2>
25172517
&#39;schema&#39;: [col.to_dict(name)
25182518
for name, col in self.schema.items()] if isinstance(self.schema, (OrderedDict, dict)) else []
25192519
}
2520-
if legacy_manifest:
2520+
if legacy_manifest or self.stage == &#39;in&#39;:
25212521
fields[&#39;columns&#39;] = self.column_names
25222522

25232523
new_dict = fields.copy()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
setuptools.setup(
1515
name="keboola.component",
16-
version="1.6.4",
16+
version="1.6.5",
1717
author="Keboola KDS Team",
1818
project_urls=project_urls,
1919
setup_requires=['pytest-runner', 'flake8'],

src/keboola/component/dao.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ def _filter_attributes_by_manifest_type(self, manifest_type: Literal["in", "out"
12151215
'schema': [col.to_dict(name)
12161216
for name, col in self.schema.items()] if isinstance(self.schema, (OrderedDict, dict)) else []
12171217
}
1218-
if legacy_manifest:
1218+
if legacy_manifest or self.stage == 'in':
12191219
fields['columns'] = self.column_names
12201220

12211221
new_dict = fields.copy()

tests/test_interface.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,38 @@ def test_full_input_manifest(self):
714714
'Education', 'Urban', 'US', 'High']
715715
}, old_manifest)
716716

717+
def test_full_input_manifest_dtypes_support(self):
718+
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data_examples', 'data_full_input_manifest')
719+
os.environ["KBC_DATADIR"] = path
720+
os.environ['KBC_DATA_TYPE_SUPPORT'] = 'authoritative'
721+
722+
ci = CommonInterface()
723+
tables = ci.get_input_tables_definitions()
724+
725+
ci.write_manifests([tables[0]])
726+
manifest_filename = tables[0].full_path + '.manifest'
727+
with open(manifest_filename) as manifest_file:
728+
old_manifest = json.load(manifest_file)
729+
730+
self.maxDiff = None
731+
732+
self.assertEqual({
733+
'id': 'in.c-main.test',
734+
'uri': 'https://connection.keboola.com//v2/storage/tables/in.c-main.test',
735+
'name': 'sample.csv',
736+
'created': '2015-11-02T09:11:37+0100',
737+
'last_change_date': '2015-11-02T09:11:37+0100',
738+
'last_import_date': '2015-11-02T09:11:37+0100',
739+
'rows_count': 400,
740+
'data_size_bytes': 81920,
741+
'is_alias': False,
742+
'indexed_columns': ['x'],
743+
'primary_key': ['x'],
744+
'column_metadata': {'x': [{'key': 'foo', 'value': 'gogo'}]},
745+
'columns': ['x', 'Sales', 'CompPrice', 'Income', 'Advertising', 'Population', 'Price', 'ShelveLoc', 'Age',
746+
'Education', 'Urban', 'US', 'High']
747+
}, old_manifest)
748+
717749

718750
class TestConfiguration(unittest.TestCase):
719751

0 commit comments

Comments
 (0)