singer-io / tap-taboola

A Singer tap for extracting data from the Taboola API
GNU Affero General Public License v3.0
2 stars 11 forks source link

Execution raises this error "float() argument must be a string or a number, not 'NoneType'" #14

Open nazanian opened 7 months ago

nazanian commented 7 months ago

After configuring Stitch's Taboola component and running an extraction, it gives the error "float() argument must be a string or number, not 'NoneType'".

Log:

2024-03-19 12:15:55,762Z main - INFO Running tap-taboola version 0.2.1 and target-stitch version 3.2.0 2024-03-19 12:15:57,640Z main - INFO [smart-services] building smart service producer: topic( com.stitchdata.extractionJobStarted ), use_ssl( true ) 2024-03-19 12:15:57,643Z main - INFO [smart-services] building smart service producer: topic( com.stitchdata.extractionJobFinished ), use_ssl( true ) 2024-03-19 12:15:57,643Z main - INFO [smart-services] building smart service producer: topic( com.stitchdata.streamRecordCount ), use_ssl( true ) 2024-03-19 12:15:57,660Z main - INFO [smart-services] event failed to send to kafka: com.stitchdata.extractionJobStarted KafkaError{code=UNKNOWN_TOPIC_OR_PART,val=3,str="Broker: Unknown topic or partition"} 2024-03-19 12:15:58,058Z main - INFO Current state: {} 2024-03-19 12:15:58,059Z main - INFO Starting tap: tap-env/bin/tap-taboola --config /tmp/tap_config.json --state /tmp/tap_state.json 2024-03-19 12:15:58,062Z main - INFO Starting target: target-env/bin/target-stitch --config /tmp/target_config.json 2024-03-19 12:15:58,318Z tap - INFO Starting sync. 2024-03-19 12:15:58,318Z tap - INFO Generating new token with password auth 2024-03-19 12:15:58,515Z target - INFO Using batch_size_prefernces of {'full_table_streams': [], 'user_batch_size_preference': None, 'batch_size_preference': None} 2024-03-19 12:15:58,673Z tap - INFO Got response code: 401 2024-03-19 12:15:58,674Z tap - INFO Retrying with client credentials authentication. 2024-03-19 12:15:58,914Z tap - INFO Got response code: 200 2024-03-19 12:15:58,914Z tap - INFO Got an access token. 2024-03-19 12:15:58,914Z tap - INFO Making request: GET https://backstage.taboola.com/backstage/api/1.0/token-details/ {} 2024-03-19 12:15:59,007Z tap - INFO Got response code: 200 2024-03-19 12:15:59,007Z tap - INFO Verified account access via token details endpoint. 2024-03-19 12:15:59,008Z tap - INFO Making request: GET https://backstage.taboola.com/backstage/api/1.0/publicisspain-selfmanaged-dkv-sc/campaigns/ {} 2024-03-19 12:15:59,176Z tap - INFO Got response code: 200 2024-03-19 12:15:59,177Z tap - INFO Synced 4 campaigns. 2024-03-19 12:15:59,177Z tap - CRITICAL float() argument must be a string or a number, not 'NoneType' 2024-03-19 12:15:59,177Z tap - Traceback (most recent call last): 2024-03-19 12:15:59,177Z tap - File "tap-env/bin/tap-taboola", line 33, in 2024-03-19 12:15:59,178Z tap - sys.exit(load_entry_point('tap-taboola==0.2.1', 'console_scripts', 'tap-taboola')()) 2024-03-19 12:15:59,178Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_taboola/init.py", line 332, in main 2024-03-19 12:15:59,178Z tap - raise exc 2024-03-19 12:15:59,178Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_taboola/init.py", line 329, in main 2024-03-19 12:15:59,178Z tap - main_impl() 2024-03-19 12:15:59,178Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_taboola/init.py", line 322, in main_impl 2024-03-19 12:15:59,178Z tap - do_sync(args) 2024-03-19 12:15:59,178Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_taboola/init.py", line 307, in do_sync 2024-03-19 12:15:59,178Z tap - sync_campaigns(access_token, config.get('account_id')) 2024-03-19 12:15:59,178Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_taboola/init.py", line 207, in sync_campaigns 2024-03-19 12:15:59,178Z tap - parsed_campaigns = parse_campaign(record) 2024-03-19 12:15:59,178Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_taboola/init.py", line 178, in parse_campaign 2024-03-19 12:15:59,178Z tap - 'cpc': float(campaign.get('cpc', 0.0)), 2024-03-19 12:15:59,178Z tap - TypeError: float() argument must be a string or a number, not 'NoneType' 2024-03-19 12:15:59,204Z target - INFO Requests complete, stopping loop 2024-03-19 12:15:59,248Z main - INFO Target exited normally with status 0 2024-03-19 12:15:59,645Z main - INFO [smart-services] event failed to send to kafka: com.stitchdata.extractionJobFinished KafkaError{code=UNKNOWN_TOPIC_OR_PART,val=3,str="Broker: Unknown topic or partition"} 2024-03-19 12:15:59,649Z main - INFO No tunnel subprocess to tear down 2024-03-19 12:15:59,649Z main - INFO Exit status is: Tap failed with code 1 and error message: "float() argument must be a string or a number, not 'NoneType'". Target succeeded.