Commit f88a938
authored
Enforces default Top for CDP Connector for non delegating expression. (#2904)
This pull request introduces a new delegation parameter class to handle
`$top` query parameters for paginated data retrieval, updates the
`ConnectorSettings` class to support configurable maximum row limits,
and integrates these changes into the existing `CdpTable` and
`CdpTableValue` implementations. It also includes updates to tests to
validate the new functionality.
### Enhancements for pagination and delegation:
* **Added `DefaultCDPDelegationParameter` class**: This new class
implements delegation parameters to generate OData query strings,
including `$top` for row limits.
(`src/libraries/Microsoft.PowerFx.Connectors/Tabular/DefaultCDPDelegationParameter.cs`)
* **Updated `CdpTableValue.Rows` property**: Modified to use the new
`DefaultCDPDelegationParameter` for setting the maximum number of rows
via `$top`.
(`src/libraries/Microsoft.PowerFx.Connectors/Public/CdpTableValue.cs`)
### Configuration improvements:
* **Enhanced `ConnectorSettings`**: Introduced a `DefaultConnectorTop`
constant and updated the `MaxRows` property to use this default value,
with the option to override it when creating new connector settings.
(`src/libraries/Microsoft.PowerFx.Connectors/Public/ConnectorSettings.cs`)
[[1]](diffhunk://#diff-5b668106d359b647dc2d970cc4c94e742319a83eea6389adb346c39ac208f4b3L14-R26)
[[2]](diffhunk://#diff-5b668106d359b647dc2d970cc4c94e742319a83eea6389adb346c39ac208f4b3L41-R47)
### Integration with `CdpTable`:
* **Exposed `ConnectorSettings` in `CdpTable`**: Added a new property to
provide access to `ConnectorSettings` from `CdpTable`.
(`src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpTable.cs`)
* **Utilized delegation parameters in `Query` method**: Updated the
query logic to use `DefaultCDPDelegationParameter` for constructing
OData query strings with `$top`.
(`src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpTable.cs`)
### Test updates:
* **Modified test cases**: Updated tests to validate the correct
generation of `$top` query parameters and ensure the new functionality
works as expected.
(`src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/PowerPlatformTabularTests.cs`)
[[1]](diffhunk://#diff-7b1be2cff9606912fdb9b09ff75af4e880829323c9e42a7252a1f93feb1ded67L82-R82)
[[2]](diffhunk://#diff-7b1be2cff9606912fdb9b09ff75af4e880829323c9e42a7252a1f93feb1ded67R143-R146)1 parent 5c8c823 commit f88a938
File tree
7 files changed
+78
-5
lines changed- src
- libraries/Microsoft.PowerFx.Connectors
- Public
- Tabular
- Services
7 files changed
+78
-5
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
41 | | - | |
| 47 | + | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| |||
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
141 | | - | |
| 144 | + | |
| 145 | + | |
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
| |||
0 commit comments