Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.2 kB
1
Indexable
Never
            elif eprm_table_type == 'MASTER-CHILD':
                qry = f"select * from {schema_tar}.etl_ppm_replication_master WHERE eprm_table_name=" + "'" + eprm_parent_table_name + "'"
                df_child=pd.read_sql(qry,cursor_tar)
                filtered_df_child = df_child[
                    df_child['eprm_catalog'].isin(['PC']) & (df_child['eprm_enabled_flg'] == 'Y') & df_child[
                        'eprm_table_type'].isin(
                        ['MASTER'])]


iam getting below error
Traceback (most recent call last):
  File "ppm_pc_replication_delete.py", line 202, in <module>
    df_child=pd.read_sql(qry,cursor_tar)
  File "/app/software/binaries/python3.7.3/lib/python3.7/site-packages/pandas/io/sql.py", line 380, in read_sql
    chunksize=chunksize)
  File "/app/software/binaries/python3.7.3/lib/python3.7/site-packages/pandas/io/sql.py", line 1468, in read_query
    cursor = self.execute(*args)
  File "/app/software/binaries/python3.7.3/lib/python3.7/site-packages/pandas/io/sql.py", line 1426, in execute
    cur = self.con.cursor()
AttributeError: 'MySQLCursor' object has no attribute 'cursor'