Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Parsing "Start Date" Column for BulkAssetGroup #302

Open
VadimSaratov opened this issue Nov 19, 2024 · 2 comments · May be fixed by #303
Open

Error Parsing "Start Date" Column for BulkAssetGroup #302

VadimSaratov opened this issue Nov 19, 2024 · 2 comments · May be fixed by #303

Comments

@VadimSaratov
Copy link

VadimSaratov commented Nov 19, 2024

When attempting to download and parse the BulkAssetGroup object, the SDK throws an error related to the Start Date column.

[ERROR] [BulkServiceManager.EntityReadException] Couldn't parse column Start Date of <class 'bingads.v13.bulk.entities.bulk_asset_group.BulkAssetGroup'> entity: unconverted data remains:  00:00:00 See ColumnValues for detailed row information and InnerException for error details.

It cannot process the Start Date column when the format is YYYY-MM-DD HH:MM:SS. It appears the BulkAssetGroup expects the date format to be YYYY-MM-DD
Probably the same issue with End Date

Or is it a bug with CSV generation?

If the issue is the date format, then
Suggested Fix:
Update the BulkAssetGroup to handle datetime formats in the Start Date and End Date columns.

        _SimpleBulkMapping(
            header=_StringTable.StartDate,
            field_to_csv=lambda c: bulk_datetime_str(c.asset_group.StartDate),
            csv_to_field=lambda c, v: setattr(c.asset_group, 'StartDate', parse_datetime(v))
        ),
        _SimpleBulkMapping(
            header=_StringTable.EndDate,
            field_to_csv=lambda c: bulk_datetime_str(c.asset_group.EndDate),
            csv_to_field=lambda c, v: setattr(c.asset_group, 'EndDate', parse_datetime(v))
        ),

Environment:

  • SDK Version: v13.0.21.2
  • Python Version: Python 3.11

Let me know if you'd like any further refinements!

@VadimSaratov VadimSaratov linked a pull request Nov 20, 2024 that will close this issue
@xinyuwen2
Copy link
Collaborator

@VadimSaratov
Copy link
Author

@xinyuwen2 then probably something is wrong with the csv file, since I'm getting Start Date 11/18/2024 00:00:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants