I am trying to pass keyword arguments into a Python function using PythonKit. So far, I have just passed strings, but this is stumping me. I do not know how PythonKit processes these dictionary inputs. I have put what I have tried so far (nonworking) and what my Python function expects. Thank you in advance!
private func createDBDirectory() {
let DBDirectoryPath = createDirectory(folderName: "databases")!.path
userConfig.DBPath = DBDirectoryPath + "/fileORGS.db"
let sqlInteract = Python.import("sqlFunctions")
let tagInfoCols: [String: PythonObject] = ["tag": "NULL", "tagHashID": "NULL", "tagCreationTime": "NULL", "tagColor": "NULL"]
sqlInteract.sqlCreateTable.callas(userConfig.DBPath, "tagINFO", tagInfoCols)
}
}
def sqlCreateTable(databasePath, tableName: str, **columns):
Error message given by this code:
PythonKit/Python.swift:553: Fatal error: Could not access PythonObject member 'callas'
I expect the dictionary or kwargs to be passed into the Python function without raising an exception.