Hello!
I have an issue with using Ruby SDK to add a dataset to a project.
I’m following those docs: https://sdk.gooddata.com/gooddata-ruby-doc/docs/advanced_blueprint_examples#playing-with-computed-attributes with sample code like below
blueprint = project.blueprint
update = GoodData::Model::ProjectBlueprint.build('update') do |p|
p.add_dataset('dataset.mynewdataset') do |d|
d.add_anchor(...)
d.add_attribute(attribute_id, title: attribute_title)
# other attributes
end
end
new_blueprint = blueprint.merge(update)
project.update_from_blueprint(new_blueprint)
But every time I’m getting an error saying, that some object already exists, each time giving a different object id for the original blueprint. So it looks like it was trying to duplicate already existing objects instead of only adding a new dataset. I see there’s an option to pass update preference, but I don’t want to allow cascade drops as I don’t want to risk loosing current data model.
Do you have any suggestions on what I may be doing wrong?
Best,
Hanna
Best answer by Marek Horvát
View original