Skip to content

adb ingest returning error on valid csv file #309

Closed

Description

@luisremis

I have a file:

videos.adb.csv

filename,url,guid,sequence,date:date_captured,constraint_guid
data/videos/a54d9ce42488863437c4c9b8c39ef871.mp4,https://multimedia-commons.s3-us-west-2.amazonaws.com/data/videos/mp4/a54/d9c/a54d9ce42488863437c4c9b8c39ef871.mp4,a54d9ce42488863437c4c9b8c39ef871,0,2023-09-21T21:55:07.458368,a54d9ce42488863437c4c9b8c39ef871
data/videos/972e6dfced72f7d19396bee5c8292b2a.mp4,https://multimedia-commons.s3-us-west-2.amazonaws.com/data/videos/mp4/972/e6d/972e6dfced72f7d19396bee5c8292b2a.mp4,972e6dfced72f7d19396bee5c8292b2a,1,2023-09-21T21:55:07.458372,972e6dfced72f7d19396bee5c8292b2a
data/videos/e869b2342bd7ba30a49cba61d3de9db.mp4,https://multimedia-commons.s3-us-west-2.amazonaws.com/data/videos/mp4/e86/9b2/e869b2342bd7ba30a49cba61d3de9db.mp4,e869b2342bd7ba30a49cba61d3de9db,2,2023-09-21T21:55:07.458374,e869b2342bd7ba30a49cba61d3de9db
data/videos/468c3ebc15fde7d5654fe0b65efd2539.mp4,https://multimedia-commons.s3-us-west-2.amazonaws.com/data/videos/mp4/468/c3e/468c3ebc15fde7d5654fe0b65efd2539.mp4,468c3ebc15fde7d5654fe0b65efd2539,3,2023-09-21T21:55:07.458375,468c3ebc15fde7d5654fe0b65efd2539
data/videos/79b2c89e9476f745a309e339596ea94.mp4,https://multimedia-commons.s3-us-west-2.amazonaws.com/data/videos/mp4/79b/2c8/79b2c89e9476f745a309e339596ea94.mp4,79b2c89e9476f745a309e339596ea94,4,2023-09-21T21:55:07.458376,79b2c89e9476f745a309e339596ea94
data/videos/5fe42bb5fa25ba69d97d27d0f1c5ac7.mp4,https://multimedia-commons.s3-us-west-2.amazonaws.com/data/videos/mp4/5fe/42b/5fe42bb5fa25ba69d97d27d0f1c5ac7.mp4,5fe42bb5fa25ba69d97d27d0f1c5ac7,5,2023-09-21T21:55:07.458378,5fe42bb5fa25ba69d97d27d0f1c5ac7
data/videos/92353162f99d1988ffbbd7d119ac8c.mp4,https://multimedia-commons.s3-us-west-2.amazonaws.com/data/videos/mp4/923/531/92353162f99d1988ffbbd7d119ac8c.mp4,92353162f99d1988ffbbd7d119ac8c,6,2023-09-21T21:55:07.458379,92353162f99d1988ffbbd7d119ac8c
data/videos/5573f4dd80f6c427e9f1c3d16751ad8.mp4,https://multimedia-commons.s3-us-west-2.amazonaws.com/data/videos/mp4/557/3f4/5573f4dd80f6c427e9f1c3d16751ad8.mp4,5573f4dd80f6c427e9f1c3d16751ad8,7,2023-09-21T21:55:07.458380,5573f4dd80f6c427e9f1c3d16751ad8
data/videos/1f83301f5bfcd37f5ecdc71ae20bffe.mp4,https://multimedia-commons.s3-us-west-2.amazonaws.com/data/videos/mp4/1f8/330/1f83301f5bfcd37f5ecdc71ae20bffe.mp4,1f83301f5bfcd37f5ecdc71ae20bffe,8,2023-09-21T21:55:07.458381,1f83301f5bfcd37f5ecdc71ae20bffe

When I run load_videos.py:

import argparse

from aperturedb import Utils
from aperturedb import ParallelLoader
from aperturedb import VideoDataCSV

def main(params):

    db = Utils.create_connector()

    data = VideoDataCSV.VideoDataCSV(params.in_file)

    loader = ParallelLoader.ParallelLoader(db)
    loader.ingest(data)

def get_args():
    obj = argparse.ArgumentParser()

    # Run Config
    obj.add_argument('-in_file', type=str, default="data/videos.adb.csv")

    params = obj.parse_args()

    return params

if __name__ == "__main__":
    args = get_args()
    main(args)

It works as normal:

remis@server:~/ad/apps/demos/videos$ python3 load_videos.py
[22:20:12] Available configurations:                                                                                                      configure.py:93
           {                                                                                                                              configure.py:94
               'global': {
                   'coco': [coco.datasets.cloud.aperturedata.io:55555 as admin using TCP with SSL=True],
                   'local_coco': [localhost:55555 as admin using TCP with SSL=True],
                   'yfcc': [yfcc100m.datasets.cloud.aperturedata.io:55555 as admin using TCP with SSL=True],
                   'default': [localhost:55555 as admin using TCP with SSL=True]
               },
               'active': 'default'
           }
Progress: 100.00% - ETA(s): 0.29
============ ApertureDB Loader Stats ============
Total time (s): 0.572098970413208
Total queries executed: 50
Avg Query time (s): 0.029411821365356444
Query time std: 0.020793123218070052
Avg Query Throughput (q/s): 135.9997380070965
Overall insertion throughput (element/s): 87.39746544883076
Total inserted elements: 50
Total successful commands: 50
=================================================

But when running:

adb ingest from-csv         --batchsize 10          --num-workers 16        --ingest-type VIDEO     --stats   data/videos.adb.csv

I get:

remis@server:~/ad/apps/demos/videos$ adb ingest from-csv         --batchsize 10          --num-workers 16        --ingest-type VIDEO     --stats   data/videos.adb.csv
[22:21:11] Available configurations:                                                                                                      configure.py:93
           {                                                                                                                              configure.py:94
               'global': {
                   'coco': [coco.datasets.cloud.aperturedata.io:55555 as admin using TCP with SSL=True],
                   'local_coco': [localhost:55555 as admin using TCP with SSL=True],
                   'yfcc': [yfcc100m.datasets.cloud.aperturedata.io:55555 as admin using TCP with SSL=True],
                   'default': [localhost:55555 as admin using TCP with SSL=True]
               },
               'active': 'default'
           }
           <aperturedb.Connector.Connector object at 0x7f17790f4250>                                                                         ingest.py:59
[                                        ] | 0% Completed |  0.1s2023-09-21 22:21:16,097 - distributed.worker - WARNING - Compute Failed
Key:       ('process-47e9def411bea0a3717ef8d2f29f85e3', 1)
Function:  execute_task
args:      ((subgraph_callable-623a0788-058c-4401-8ddb-c2db678cd630, 'localhost', 55555, True, Session(session_token='adbs_KWwUy8IzmO8WuOVlkNdQL8z6ytXmcJ7Nfgp', refresh_token='adbr_vf4NVkKfGjsyx7zlT5CL5zXlAeJoF2KtgFu', session_token_ttl=36000, refresh_token_ttl=360000, session_started=1695334871.2662113), <class 'aperturedb.Connector.Connector'>, 'astype-966cf123e92b62bc18730a6cca4b54de', 'read-csv-9cb417bfb171330322c9fbb0ce0723ef', [(<function read_block_from_file at 0x7f78ad2227a0>, <OpenFile '/home/remis/ad/apps/demos/videos/data/videos.adb.csv'>, 183, 183, b'\n'), None, False, False]))
kwargs:    {}
Exception: 'TypeError("aperturedb.CSVParser.CSVParser.__init__() got multiple values for keyword argument \'df\'")'

2023-09-21 22:21:16,138 - distributed.worker - WARNING - Compute Failed
Key:       ('process-47e9def411bea0a3717ef8d2f29f85e3', 24)
Function:  execute_task
args:      ((subgraph_callable-623a0788-058c-4401-8ddb-c2db678cd630, 'localhost', 55555, True, Session(session_token='adbs_KWwUy8IzmO8WuOVlkNdQL8z6ytXmcJ7Nfgp', refresh_token='adbr_vf4NVkKfGjsyx7zlT5CL5zXlAeJoF2KtgFu', session_token_ttl=36000, refresh_token_ttl=360000, session_started=1695334871.2662113), <class 'aperturedb.Connector.Connector'>, 'astype-966cf123e92b62bc18730a6cca4b54de', 'read-csv-9cb417bfb171330322c9fbb0ce0723ef', [(<function read_block_from_file at 0x7f78ad2227a0>, <OpenFile '/home/remis/ad/apps/demos/videos/data/videos.adb.csv'>, 4400, 184, b'\n'), None, False, False]))
kwargs:    {}
Exception: 'TypeError("aperturedb.CSVParser.CSVParser.__init__() got multiple values for keyword argument \'df\'")'

Activity

  1. added
    bug
    on Sep 21, 2023
  2. gsaluja9 commented on Jan 25, 2024

    @gsaluja9
    Contributor

    This log seems to suggest that ingestion is running in dask mode. This used to be default but is not anymore. This file should work fine with the non dask .

  3. added
    wontfix
    on Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions