ValueError: not enough values to unpack (expected 2, got 1)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 03:11 AM
Code:
Writer.jdbc_writer("Economy",economy,conf=CONF.MSSQL.to_dict(), modified_by=JOB_ID['Economy'])The problem arises when i try to run the code, in the specified databricks notebook, An error of "ValueError: not enough values to unpack (expected 2, got 1)",
here's the full error message:
ValueError: not enough values to unpack (expected 2, got 1)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<command-75945229> in <cell line: 1>()
----> 1 Writer.jdbc_writer("Economy",economy,conf=CONF.MSSQL.to_dict(), modified_by=JOB_ID['Economy'])
2
3
<command-75945229> in jdbc_writer(table_name, df, conf, debug, modified_by)
15 conf = conf.to_dict()
16
---> 17 schema, table = table_name.split('.')
18 schema = schema[1:-1] if schema[0] == "[" else schema
19 table = table[1:-1] if table[0] == "[" else tableAnd when I clicked the cell, this is the line of code:
class Writer:
@staticmethod
def jdbc_writer(table_name:str,
df:SparkDataFrame,
conf:Union[dict ,SqlConnect ],
debug=False,
modified_by = None,
) -> NoI have searched for solutions regarding this particular problem but have never seem to find it, and your help would really benefit me.
Labels:
- Labels:
-
Databricks notebook
-
Python