Closed GoogleCodeExporter closed 9 years ago
This is not a defect. By design, pygrametl expects that every dimension table
has a non-composite key (otherwise, the fact table would also need several FK
columns to reference single a dimension value).
pygrametl does support several lookupatts (for the "business key"):
dim = Dimension(name='dimtest', key='a', attributes=('b','c','d'),
lookupatts=('b','c'))
dim.ensure({'a':0 ,'b':0 , 'c':0 , 'd':0})
dim.ensure({'a':1 ,'b':1 , 'c':1 , 'd':1})
dim.ensure({'a':2 ,'b':2 , 'c':2 , 'd':2})
print(dim.lookup({'b':1, 'c':1})) # prints 1 as expected
print(dim.lookup({'b':1, 'c':9999})) # prints None as expected
Original comment by c...@cs.aau.dk
on 3 Apr 2014 at 7:33
Original issue reported on code.google.com by
xia...@gmail.com
on 3 Apr 2014 at 1:43