MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / _get_partition_keys

Method _get_partition_keys

cassandra/cqlengine/named.py:116–122  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

114 return self.__partition_keys
115
116 def _get_partition_keys(self):
117 try:
118 table_meta = get_cluster(self._get_connection()).metadata.keyspaces[self.keyspace].tables[self.name]
119 self.__partition_keys = OrderedDict((pk.name, Column(primary_key=True, partition_key=True, db_field=pk.name)) for pk in table_meta.partition_key)
120 except Exception as e:
121 raise CQLEngineException("Failed inspecting partition keys for {0}."
122 "Ensure cqlengine is connected before attempting this with NamedTable.".format(self.column_family_name()))
123
124 def column(self, name):
125 return NamedColumn(name)

Callers 1

_partition_keysMethod · 0.95

Calls 5

column_family_nameMethod · 0.95
get_clusterFunction · 0.90
ColumnClass · 0.90
CQLEngineExceptionClass · 0.90
_get_connectionMethod · 0.80

Tested by

no test coverage detected