I am trying to load data from csvs to postgres for...
# announcements
n
I am trying to load data from csvs to postgres for learning. I am using tap-csv and target-postgres but getting a weird error from target postgres
Copy code
> tap-csv -c tap_config.json | singer-check-tap                                                                                                                                             
INFO Starting sync
INFO Syncing entity 'employees' from file: '/Users/nehiljain/personal/ext-nehiljain-exercise/data/input/employee_data_a0/2020-01-01.csv'
INFO Sync completed
Checking stdin for valid Singer-formatted data
The output is valid.
It contained 52 messages for 1 streams.

      1 schema messages
     50 record messages
      1 state messages

Details by stream:
+-----------+---------+---------+
| stream    | records | schemas |
+-----------+---------+---------+
| employees | 50      | 1       |
+-----------+---------+---------+
> tap-csv -c tap_config.json | target-postgres                                                                                                                                              
INFO Starting sync
INFO Syncing entity 'employees' from file: '/Users/nehiljain/personal/ext-nehiljain-exercise/data/input/employee_data_a0/2020-01-01.csv'
INFO Sync completed
Traceback (most recent call last):
  File "/usr/local/anaconda3/envs/ext-nj-master/bin/target-postgres", line 33, in <module>
    sys.exit(load_entry_point('target-postgres', 'console_scripts', 'target-postgres')())
  File "/Users/nehiljain/personal/ext-nehiljain-exercise/target-postgres/target_postgres/__init__.py", line 188, in main
    state = persist_lines(config, input)
  File "/Users/nehiljain/personal/ext-nehiljain-exercise/target-postgres/target_postgres/__init__.py", line 150, in persist_lines
    stream_to_sync[stream] = DbSync(config, o)
  File "/Users/nehiljain/personal/ext-nehiljain-exercise/target-postgres/target_postgres/db_sync.py", line 119, in __init__
    self.schema_name = self.connection_config['schema']
KeyError: 'schema'
Anyone has pointers as to why the keyerror is happening?
n
It looks as though you have not configured the schema in the target configuration, hence the key error
n
That worked thanks
the env was not getting loaded when i was running the target