-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update dev docs on how to use new object model #1054
Conversation
r.lastupdated = $UpdateTag | ||
``` | ||
|
||
#### Connecting different node types with the `_attach` pattern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like their may be cases where we want to attach after loading. But in the cases I can think of, it's still best to transform the data and use a NodeSchema that properly defines those extra relationships.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, and yes that's the approach I would encourage.
It's also possible to first generate a query using selected_relationships
and then load to that with additional data, but I don't have an example ready for that and that sounds complicated and I'm not ready to encourage that pattern in the doc yet.
As another example, `region: PropertyRef = PropertyRef('Region', set_in_kwargs=True)` tells the querybuilder to set a field called `region` on the `EMRCluster` node using a keyword argument called `Region` supplied to `cartography.client.core.tx.load_graph_data()`. `set_in_kwargs=True` is useful in cases where we want every object loaded by a single call to `load_graph_data()` to have the same value for a given attribute. | ||
|
||
|
||
#### Defining relationships |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth adding an example here on the other_relationships
, even if it's only pointing to the test cases we have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added below
* Update dev docs on how to use new object model * linter * example of other_relationships
Update the how-to-write-an-intel-module docs using the new cartography object model introduced in #1038.