Skip to content

DatePreset in AdSet has wrong values? #698

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

Open
zdendos opened this issue Mar 8, 2025 · 0 comments
Open

DatePreset in AdSet has wrong values? #698

zdendos opened this issue Mar 8, 2025 · 0 comments

Comments

@zdendos
Copy link

zdendos commented Mar 8, 2025

I noted, that values in DatePreset in AdSet class ( https://github.com/facebook/facebook-python-business-sdk/blob/main/facebook_business/adobjects/adset.py ) have upper case values. I think that here should be lower case values.

When I will call function get_ad_sets with:

params = {
    'date_preset': AdSet.DatePreset.last_90d,
}

I will get this response:

Status: 400
Response:
{
"error": {
"message": "(#100) date_preset must be one of the following values: today, yesterday, this_month, last_month, this_quarter, maximum, data_maximum, last_3d, last_7d, last_14d, last_28d, last_30d, last_90d, last_week_mon_sun, last_week_sun_sat, last_quarter, last_year, this_week_mon_today, this_week_sun_today, this_year",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "A1IbYeQ5SubADE2urVX8FHV"
}
}

But when I wil do same with `Ad.DatePreset.last_90d' then all working well + I will get this warning:
UserWarning: value of date_preset might not be compatible. Expect date_preset_enum; got <class 'str'>
warnings.warn(message)

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

No branches or pull requests

1 participant