Skip to content

Commit

Permalink
squash: Note that empty trait set is valid
Browse files Browse the repository at this point in the history
Signed-off-by: David Feltell <david.feltell@foundry.com>
  • Loading branch information
feltech committed Nov 28, 2023
1 parent ce1378f commit 37246ed
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions examples/querying_entity_traits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,46 @@
},
"id": "dbb66de3947d7b24"
},
{
"cell_type": "markdown",
"source": [
"## An empty trait set is a valid response\n",
"\n",
"BAL has no restrictions on publishing to new entity references, so what happens if we try to get the trait set for one?"
],
"metadata": {
"collapsed": false
},
"id": "1bfdacf358dad9fa"
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"new_entity_ref = manager.createEntityReference(\"bal:///some/new/ref\")\n",
"\n",
"entity_trait_set = manager.entityTraits(new_entity_ref, EntityTraitAccess.kWrite, context)\n",
"\n",
"helpers.display_result(entity_trait_set)"
],
"metadata": {
"collapsed": false
},
"id": "c771cf01dc76f671"
},
{
"cell_type": "markdown",
"source": [
"...an empty trait set is returned.\n",
"\n",
"If the manager does not know the trait set, or it's not applicable, the returned trait set may be empty. For example, as illustrated here, the entity reference may point to a new entity with no type constraints. "
],
"metadata": {
"collapsed": false
},
"id": "2985087ccc829642"
},
{
"cell_type": "markdown",
"source": [
Expand Down

0 comments on commit 37246ed

Please sign in to comment.