MCPcopy Create free account
hub / github.com/alephdata/aleph / create_table_entity

Method create_table_entity

aleph/tests/test_mappings_api.py:31–49  ·  view source on GitHub ↗

Create a table entitiy to use as the mapping source.

(self, collection, entity_id)

Source from the content-addressed store, hash-verified

29 self.content_hash = archive.archive_file(fixture)
30
31 def create_table_entity(self, collection, entity_id):
32 """Create a table entitiy to use as the mapping source."""
33 data = {
34 "id": entity_id,
35 "schema": "Table",
36 "properties": {
37 "csvHash": self.content_hash,
38 "contentHash": self.content_hash,
39 "mimeType": "text/csv",
40 "fileName": "experts.csv",
41 "name": "experts.csv",
42 },
43 }
44
45 table = EntityProxy.from_dict(model, data, cleaned=False)
46 table.id = collection.ns.sign(table.id)
47 index_proxy(collection=collection, proxy=table)
48
49 return table
50
51 def create_mapping(self, collection, table, role):
52 query = {

Calls 1

index_proxyFunction · 0.90

Tested by

no test coverage detected