Skip to content
This repository was archived by the owner on Apr 15, 2022. It is now read-only.

Commit 8e037f8

Browse files
authored
DBAAS-2869: add check to types variable before using (#22)
1 parent 4711379 commit 8e037f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

splicemachine/spark/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ def _generateDBSchema(self, dataframe, types={}):
261261
Generate the schema for create table
262262
"""
263263
#convert keys and values to uppercase in the types dictionary
264-
types = dict((key.upper(), val) for key,val in types.items())
264+
if(types):
265+
types = dict((key.upper(), val) for key,val in types.items())
265266
db_schema = []
266267
#convert dataframe to have all uppercase column names
267268
dataframe = self.toUpper(dataframe)
@@ -323,7 +324,6 @@ def createTable(self, dataframe, schema_table_name, new_schema=True, drop_table=
323324
StringType: VARCHAR(150)
324325
TimestampType: TIMESTAMP
325326
UnknownType: BLOB
326-
NOTE: If the table supplied already exists, it WILL be dropped.
327327
'''
328328
db_schema = self._generateDBSchema(dataframe, types=types)
329329
schema, table = self._getCreateTableSchema(schema_table_name, new_schema=new_schema)

0 commit comments

Comments
 (0)