Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

[BUG]ET_DataExtension requires a columns list, even if there is no intent to add columns #131

Open
1 of 4 tasks
cheitzig opened this issue Feb 24, 2021 · 1 comment
Open
1 of 4 tasks
Labels

Comments

@cheitzig
Copy link

cheitzig commented Feb 24, 2021

Describe the bug
Using the ET_DataExtension() class to (for example) rename a data extension doesn't work unless you create columns attribute with an empty list.
To Reproduce
Specifically, this code, from the documentation, here, fails.

import ET_Client
myClient = ET_Client.ET_Client()
dataextension = ET_Client.ET_DataExtension()
dataextension.auth_stub = myClient
dataextension.props = {"CustomerKey" : "151515151", "Name": "SDK Example, now Updated!"}
results = dataextension.patch()
print results

It works though, if you add this line someplace before the call to patch()
dataextension.columns = []

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Code snippet

import ET_Client
myClient = ET_Client.ET_Client()
dataextension = ET_Client.ET_DataExtension()
dataextension.auth_stub = myClient
dataextension.props = {"CustomerKey" : "151515151", "Name": "SDK Example, now Updated!"}
results = dataextension.patch()
print results

Environment

  • SDK Version 1.3.0
  • Python version 3.9.1

The bug has the severity

  • Critical: The defect affects critical functionality or critical data. It does not have a workaround.
  • Major: The defect affects major functionality or major data. It has a workaround but is not obvious and is difficult.
  • Minor: The defect affects minor functionality or non-critical data. It has an easy workaround.
  • Trivial: The defect does not affect functionality or data. It does not even need a workaround. It does not impact productivity or efficiency. It is merely an inconvenience.

Additional context
Possible fix: line 176 and line 186 should have an if around them. Maybe all of 171-188 should have that if because (maybe) the only purpose of that code is to add columns for either a single or multiple DE's, but I'm not clear on that.

@cheitzig cheitzig added the bug label Feb 24, 2021
@cvvishalkumar
Copy link

Thank you so much for the work-around! I was able to resolve the below error by using blank columns. Thanks.

Traceback (most recent call last): File "d:\vishal\Python\Vishal_LearnPython\UpdateDE.py", line 11, in <module> results = request.patch() File "D:\vishal\Python\lib\site-packages\FuelSDK\objects.py", line 196, in patch for key in self.columns: TypeError: 'NoneType' object is not iterable

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

No branches or pull requests

2 participants