MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / _drop_table

Function _drop_table

cassandra/cqlengine/management.py:524–540  ·  view source on GitHub ↗
(model, connection=None)

Source from the content-addressed store, hash-verified

522
523
524def _drop_table(model, connection=None):
525 if not _allow_schema_modification():
526 return
527
528 connection = connection or model._get_connection()
529
530 # don't try to delete non existent tables
531 meta = get_cluster(connection).metadata
532
533 ks_name = model._get_keyspace()
534 raw_cf_name = model._raw_column_family_name()
535
536 try:
537 meta.keyspaces[ks_name].tables[raw_cf_name]
538 execute('DROP TABLE {0};'.format(model.column_family_name()), connection=connection)
539 except KeyError:
540 pass
541
542
543def _allow_schema_modification():

Callers 1

drop_tableFunction · 0.85

Calls 7

get_clusterFunction · 0.90
executeFunction · 0.90
_get_connectionMethod · 0.80
_get_keyspaceMethod · 0.80
column_family_nameMethod · 0.45

Tested by

no test coverage detected