-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing dataclass attributes info
Summary: The team working on [Hydra](https://hydra.cc/docs/intro/), a framework that enables storing configs in yaml files that correspond to Python schemas, heavily depends on glean to improve the dev experience. They pointed out that some dataclass fields were not indexed correctly. Example, in the class MastTorchXOptions, the fields `data_project` and `model_type_name` don't appear in the [Public Fields list](https://www.internalfb.com/code/symbol/fbsource/py/fbcode/gen_ai.genie.components.launchers.types.MastTorchXOptions) https://www.internalfb.com/code/fbsource/[24a0922d3b7d]/fbcode/gen_ai/genie/components/launchers/types.py?lines=120-121%2C175-176%2C178-179 Those symbol do exist, but they don't have any scope info. See [data_project](https://www.internalfb.com/code/symbol/fbsource/py/fbcode/gen_ai.genie.components.launchers.types.MastTorchXOptions.data_project) vs [cluster_name](https://www.internalfb.com/code/symbol/fbsource/py/fbcode/gen_ai.genie.components.launchers.types.MastTorchXOptions.cluster_name) symbol pages {F1916669718} The problem is that we don't construct the fact `VariableDefinition` for those attributes which has the container information https://www.internalfb.com/code/fbsource/[2a9473826736]/fbcode/glean/schema/source/python.angle?lines=103-109 This is happening because we are explicitly excluding attributes without a default value in our indexer here: https://www.internalfb.com/code/fbsource/[d4a3490eeee9]/fbcode/glean/lang/python/indexers/core.py?lines=1113-1114 Reviewed By: iamirzhan Differential Revision: D64041090 fbshipit-source-id: b9e5883933c0dc0d60eb0a7e1d3001f32ce73cbf
- Loading branch information
1 parent
e310725
commit 2751dc9
Showing
11 changed files
with
188 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
glean/lang/codemarkup/tests/python/cases/xrefs/contains_child_entity.perf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "@generated": null, "python.Contains.4": 29 } | ||
{ "@generated": null, "python.Contains.4": 30 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
glean/lang/codemarkup/tests/python/cases/xrefs/search_related_contains_child_of_parent.perf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"@generated": null, | ||
"python.Contains.4": 29, | ||
"python.DeclarationDefinition.4": 54, | ||
"python.DeclarationLocation.4": 54 | ||
"python.Contains.4": 30, | ||
"python.DeclarationDefinition.4": 56, | ||
"python.DeclarationLocation.4": 56 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
glean/lang/codemarkup/tests/python/cases/xrefs/search_related_contains_parent_of_child.perf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"@generated": null, | ||
"python.ClassDefinition.4": 7, | ||
"python.DeclarationDefinition.4": 58, | ||
"python.DeclarationLocation.4": 58, | ||
"python.DeclarationDefinition.4": 60, | ||
"python.DeclarationLocation.4": 60, | ||
"python.FunctionDefinition.4": 13, | ||
"python.Module.4": 8, | ||
"python.NameToSName.4": 6, | ||
"python.SNameToName.4": 2, | ||
"python.VariableDefinition.4": 7 | ||
"python.VariableDefinition.4": 8 | ||
} |