looker-open-source / pylookml

A pythonic api for automatic lookml
https://pylookml.readthedocs.io/en/latest/introduction.html
MIT License
44 stars 22 forks source link

Crash with 2 PKs & duplicate dim name #12

Closed LookerTimG closed 3 years ago

LookerTimG commented 4 years ago

Traceback (most recent call last): File "/Users/timgoldstein/working/tools_lookml/tool1_lookml.py", line 20, in myFile = proj.file('order_items.view.lkml') File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 400, in file return File(self.gitControllerSession.absoluteOutputPath + '/' + path) File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 632, in init self.vws = self.view_collection(self.json_data['views']) File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 497, in init self.add(view) File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 507, in add v = View(v) File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 891, in init super(View, self).init(input) File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 773, in init self._bind_lkml(input) File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 924, in _bind_lkml self + Dimension(field) File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 982, in add return self.addField(other) File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 1205, in addField self.setPrimaryKey(field.identifier) File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 1261, in setPrimaryKey self.unSetPrimaryKey() File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 1307, in unSetPrimaryKey pk.unSetPrimaryKey() File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 2139, in unSetPrimaryKey self.unSetProperty('primary_key') File "/usr/local/lib/python3.7/site-packages/lookml/lookml.py", line 829, in unSetProperty self.properties.del(name) AttributeError: 'Properties' object has no attribute 'del'

russlooker commented 3 years ago

fixed in latest release