Skip to content

Commit 0da23e6

Browse files
author
gdgate
authored
Merge pull request #97 from hkad98/NAS-3694
NAS-3694 finalizing documentation for release Reviewed-by: Jan Soubusta https://github.com/jaceksan
2 parents 8fdd490 + 7bc47b2 commit 0da23e6

3 files changed

Lines changed: 50 additions & 26 deletions

File tree

gooddata-sdk/docs/services/catalog-data-source.rst

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ The *gooddata_sdk.catalog_data_source* supports the following declarative API ca
159159

160160
Set all data sources, including their related physical model.
161161

162-
* ``store_declarative_data_sources(layout_root_path: Path = Path(os.path.curdir))``
162+
* ``store_declarative_data_sources(layout_root_path: Path = Path.cwd())``
163163

164164
Store data sources layouts in directory hierarchy.
165165

@@ -179,13 +179,13 @@ The *gooddata_sdk.catalog_data_source* supports the following declarative API ca
179179
│ └── table_Y.yaml
180180
└── data_source_b.yaml
181181

182-
* ``load_declarative_data_sources(layout_root_path: Path = Path(os.path.curdir))``
182+
* ``load_declarative_data_sources(layout_root_path: Path = Path.cwd())``
183183

184184
Returns *CatalogDeclarativeDataSources*.
185185

186186
Load declarative data sources layout, which was stored using *store_declarative_data_sources*.
187187

188-
* ``load_and_put_declarative_data_sources(layout_root_path: Path = Path(os.path.curdir), credentials_path: Optional[Path] = None, test_data_sources: bool = False)``
188+
* ``load_and_put_declarative_data_sources(layout_root_path: Path = Path.cwd(), credentials_path: Optional[Path] = None, test_data_sources: bool = False)``
189189

190190
This method combines *load_declarative_data_sources* and
191191
*put_declarative_data_sources* methods to load and set
@@ -228,6 +228,22 @@ The *gooddata_sdk.catalog_data_source* supports the following action API calls:
228228

229229
Invalidate cache of your computed reports to force your analytics to be recomputed.
230230

231+
* ``scan_data_source(data_source_id: str, scan_request: CatalogScanModelRequest = CatalogScanModelRequest(), report_warnings: bool = False)``
232+
233+
Returns *CatalogScanResultPdm*.
234+
235+
Scan data source specified by its id and optionally by specified scan request. *CatalogScanResultPdm* contains PDM and warnings. Warnings contain information about columns which were not added to the PDM because their data types are not supported. Additional parameter report_warnings can be passed to suppress or to report warnings. By default warnings are returned but not reported to STDOUT. If you set report_warnings to True, warnings are reported to STDOUT.
236+
237+
* ``scan_and_put_pdm(data_source_id: str, scan_request: CatalogScanModelRequest = CatalogScanModelRequest())``
238+
239+
This method combines *scan_data_source* and *put_declarative_pdm* methods.
240+
241+
* ``scan_schemata(data_source_id: str)``
242+
243+
Returns *list[str]*.
244+
245+
Returns a list of schemas that exist in the database and can be configured in the data source entity. Data source managers like Dremio or Drill can work with multiple schemas and schema names can be injected into scan_request to filter out tables stored in the different schemas.
246+
231247
**Example usage:**
232248

233249
.. code-block:: python
@@ -240,6 +256,14 @@ The *gooddata_sdk.catalog_data_source* supports the following action API calls:
240256
token = "some_user_token"
241257
sdk = GoodDataSdk.create(host, token)
242258
259+
# Scan schemata of the data source
260+
schemata = sdk.catalog_data_source.scan_schemata("demo-test-ds")
261+
print(schemata)
262+
# ['demo']
263+
264+
# Scan and put pdm
265+
sdk.catalog_data_source.scan_and_put_pdm("demo-test-ds")
266+
243267
# Define request for generating ldm
244268
generate_ldm_request = CatalogGenerateLdmRequest(separator="__")
245269

gooddata-sdk/docs/services/catalog-workspace-content.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ The *gooddata_sdk.catalog_workspace_content* supports the following declarative
6969

7070
Returns *CatalogDeclarativeModel*.
7171

72-
Retrieve a logical model layout. On CatalogDeclarativeModel user can call ``modify_mapped_data_source(data_source_mapping: dict)`` method, which substitues data source id in datasets.
72+
Retrieve a logical model layout. On CatalogDeclarativeModel user can call ``modify_mapped_data_source(data_source_mapping: dict)`` method, which substitutes data source id in datasets.
7373

74-
* ``put_declarative_ldm(workspace_id: str, ldm: CatalogDeclarativeModel)``
74+
* ``put_declarative_ldm(workspace_id: str, ldm: CatalogDeclarativeModel, validator: Optional[DataSourceValidator])``
7575

76-
Set a logical model layout.
76+
Put a logical data model into a given workspace. You can pass an additional validator parameter which checks that for every data source id in the logical data model the corresponding data source exists.
7777

78-
* ``store_declarative_ldm(workspace_id: str, layout_root_path: Path = Path(os.path.curdir))``
78+
* ``store_declarative_ldm(workspace_id: str, layout_root_path: Path = Path.cwd())``
7979

8080
Store logical data model layout in directory hierarchy.
8181

@@ -86,22 +86,22 @@ The *gooddata_sdk.catalog_workspace_content* supports the following declarative
8686
└── workspaces
8787
└── workspace_id
8888
└── analytics_model
89-
── ldm
90-
── datasets
91-
└── dataset.yaml
92-
└── date_instaces
93-
└── date_instace.yaml
89+
── ldm
90+
── datasets
91+
└── dataset.yaml
92+
└── date_instances
93+
└── date_instance.yaml
9494

95-
* ``load_declarative_ldm(workspace_id: str, layout_root_path: Path = Path(os.path.curdir))``
95+
* ``load_declarative_ldm(workspace_id: str, layout_root_path: Path = Path.cwd())``
9696

9797
Returns *CatalogDeclarativeModel*.
9898

9999
Load declarative LDM layout, which was stored using *store_declarative_ldm*.
100100

101-
* ``load_and_put_declarative_ldm(workspace_id: str, layout_root_path: Path = Path(os.path.curdir))``
101+
* ``load_and_put_declarative_ldm(workspace_id: str, layout_root_path: Path = Path.cwd(), validator: Optional[DataSourceValidator])``
102102

103103
This method combines *load_declarative_ldm* and *put_declarative_ldm*
104-
methods to load and set layouts stored using *store_declarative_ldm*.
104+
methods to load and set layouts stored using *store_declarative_ldm*. You can pass an additional validator parameter which checks that for every data source id in the logical data model the corresponding data source exists.
105105

106106
**Analytics Model:**
107107

@@ -113,9 +113,9 @@ The *gooddata_sdk.catalog_workspace_content* supports the following declarative
113113

114114
* ``put_declarative_analytics_model(workspace_id: str, analytics_model: CatalogDeclarativeAnalytics)``
115115

116-
Set an analytics model layout.
116+
Put an analytics model into a given workspace.
117117

118-
* ``store_declarative_analytics_model(workspace_id: str, layout_root_path: Path = Path(os.path.curdir))``
118+
* ``store_declarative_analytics_model(workspace_id: str, layout_root_path: Path = Path.cwd())``
119119

120120
Store declarative analytics model layout in directory hierarchy.
121121

@@ -139,13 +139,13 @@ The *gooddata_sdk.catalog_workspace_content* supports the following declarative
139139

140140

141141

142-
* ``load_declarative_analytics_model(workspace_id: str, layout_root_path: Path = Path(os.path.curdir))``
142+
* ``load_declarative_analytics_model(workspace_id: str, layout_root_path: Path = Path.cwd())``
143143

144144
Returns *CatalogDeclarativeAnalytics*.
145145

146146
Load declarative LDM layout, which was stored using *store_declarative_analytics_model*.
147147

148-
* ``load_and_put_declarative_analytics_model(workspace_id: str, layout_root_path: Path = Path(os.path.curdir))``
148+
* ``load_and_put_declarative_analytics_model(workspace_id: str, layout_root_path: Path = Path.cwd())``
149149

150150
This method combines *load_declarative_analytics_model* and
151151
*put_declarative_analytics_model* methods to load and set

gooddata-sdk/docs/services/catalog-workspace.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on workspaces:
1212
The service supports two types of methods:
1313

1414
* Entity methods let you work with workspaces on a high level using simplified *CatalogWorkspace* entities.
15-
* Declarative methods allow you to work with workpaces on a more granular level by fetching entire workspace layouts, including all of their nested objects.
15+
* Declarative methods allow you to work with workspaces on a more granular level by fetching entire workspace layouts, including all of their nested objects.
1616

1717
Entity methods
1818
^^^^^^^^^^^^^^
@@ -67,7 +67,7 @@ The *gooddata_sdk.catalog_workspace* supports the following entity API calls:
6767
# Create workspace
6868
sdk.catalog_workspace.create_or_update(my_workspace_object)
6969
70-
# Edit locak workspace entity
70+
# Edit local workspace entity
7171
my_workspace_object.name = "Test"
7272
7373
# Update workspace
@@ -107,7 +107,7 @@ The *gooddata_sdk.catalog_workspace* supports the following declarative API call
107107

108108
Set layout of all workspaces and their hierarchy.
109109

110-
* ``store_declarative_workspaces(layout_root_path: Path = Path(os.path.curdir))``
110+
* ``store_declarative_workspaces(layout_root_path: Path = Path.cwd())``
111111

112112
Store workspaces layouts in directory hierarchy.
113113

@@ -131,8 +131,8 @@ The *gooddata_sdk.catalog_workspace* supports the following declarative API call
131131
│ │ ├── ldm
132132
│ │ │ ├── datasets
133133
│ │ │ │ └── dataset.yaml
134-
│ │ │ └── date_instaces
135-
│ │ │ └── date_instace.yaml
134+
│ │ │ └── date_instances
135+
│ │ │ └── date_instance.yaml
136136
│ │ └── workspace_a.yaml
137137
│ └── workspace_b
138138
│ └── ...
@@ -142,13 +142,13 @@ The *gooddata_sdk.catalog_workspace* supports the following declarative API call
142142
└── filter_2.yaml
143143

144144

145-
* ``load_declarative_workspaces(layout_root_path: Path = Path(os.path.curdir))``
145+
* ``load_declarative_workspaces(layout_root_path: Path = Path.cwd())``
146146

147147
Returns *CatalogDeclarativeWorkspaces*.
148148

149149
Load declarative workspaces layout, which was stored using *store_declarative_workspaces*.
150150

151-
* ``load_and_put_declarative_workspaces(layout_root_path: Path = Path(os.path.curdir))``
151+
* ``load_and_put_declarative_workspaces(layout_root_path: Path = Path.cwd())``
152152

153153
This method combines *load_declarative_workspaces* and *put_declarative_workspaces* methods to load and
154154
set layouts stored using *store_declarative_workspaces*.

0 commit comments

Comments
 (0)