BingAds / BingAds-Python-SDK

Other
116 stars 162 forks source link

BulkAdGroupLocationCriterion Target mapping breaks in Python 3 #84

Closed mikeengland closed 6 years ago

mikeengland commented 6 years ago

Hi, In the BulkAdGroupLocationCriterion Target mappings, the code tries to cast the value to a Long data type if the value is defined. This is valid in Python 2, however in Python 3 it no longer exists.

NameError: name 'long' is not defined

https://github.com/BingAds/BingAds-Python-SDK/blob/master/bingads/v11/bulk/entities/target_criterions/bulk_ad_group_location_criterion.py#L68

The solution would be to use long if the Python version is 2, and int if it is Python 3.

Thanks!

qitia commented 6 years ago

@mikeengland Thanks for raising this issue. I think we could use int() since in python2, this will cast value to 'long' when necessary.

int(12345678901234) 12345678901234L

mikeengland commented 6 years ago

@qitia Sounds good to me! Thank you.

mikeengland commented 6 years ago

Hi @qitia, how do bug fixes work for this repo? Is there a bug fix/release schedule from the Microsoft team, or shall I create a PR which changes the long() to int().

qitia commented 6 years ago

oh no need to create PR here. We will release version 11.12.2 at around 15 May. I hope it is not too late for you. Thanks @mikeengland

mikeengland commented 6 years ago

@qitia That is fine, thank you! If I need to change it in the meantime, I can always fork the library.

mikeengland commented 6 years ago

@qitia It looks like this is fixed now. If it is, please feel free to close this! Thanks!

qitia commented 6 years ago

@mikeengland yes new version released and this has been fixed.