Skip to content

Add caching for Table metadata fetch in CDP and update FieldType to Scaler for Salesforce#3016

Merged
jas-valgotar merged 6 commits intomainfrom
jas/addCachingForCDPMetadata
Feb 6, 2026
Merged

Add caching for Table metadata fetch in CDP and update FieldType to Scaler for Salesforce#3016
jas-valgotar merged 6 commits intomainfrom
jas/addCachingForCDPMetadata

Conversation

@jas-valgotar
Copy link
Copy Markdown
Contributor

@jas-valgotar jas-valgotar commented Feb 4, 2026

This pull request introduces a new caching mechanism for table metadata in the CDP connector layer to improve performance and reduce redundant network calls. It also updates documentation and corrects a field type resolution behavior. The most significant changes are the introduction of a thread-safe cache for table metadata, propagation of this cache through the relevant classes, and a documentation addition for Claude Code.

Caching and Performance Improvements:

  • Added a thread-safe ConcurrentDictionary cache for table metadata in CdpDataSource, CdpTable, and CdpTableResolver to avoid redundant network requests when resolving table schemas. The cache uses the metadata URI as a key and stores tasks for async deduplication. It is cleared when reaching a maximum size to prevent unbounded growth. (src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpDataSource.cs, src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpTable.cs, src/libraries/Microsoft.PowerFx.Connectors/Tabular/CdpTableResolver.cs) [1] [2] [3] [4]
  • Updated constructors and method signatures in CdpTable and CdpTableResolver to accept and propagate the cache instance, ensuring all table metadata resolutions use the shared cache. (src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpDataSource.cs, src/libraries/Microsoft.PowerFx.Connectors/Tabular/Services/CdpTable.cs, src/libraries/Microsoft.PowerFx.Connectors/Tabular/CdpTableResolver.cs) [1] [2] [3] [4]
  • Added a method to clear the cache in CdpDataSource for scenarios where a refresh is required.

Documentation:

  • Added a comprehensive CLAUDE.md file to guide Claude Code (claude.ai/code) on building, testing, and understanding the architecture of the Power Fx codebase. This includes build commands, core architecture, testing, extensibility, and configuration details. (src/CLAUDE.md)

Bug Fixes and Behavior Changes:

  • Changed the default behavior of TryGetFieldType in CdpRecordType.cs to ignore relationships by default (passing true for the ignorelationship parameter), aligning it with the behavior of TryGetUnderlyingFieldType. (src/libraries/Microsoft.PowerFx.Connectors/Public/CdpRecordType.cs)

@jas-valgotar
Copy link
Copy Markdown
Contributor Author

✅ No public API change.

@jas-valgotar jas-valgotar force-pushed the jas/addCachingForCDPMetadata branch from 8fa6a15 to 0404099 Compare February 4, 2026 20:06
@jas-valgotar jas-valgotar marked this pull request as ready for review February 4, 2026 20:07
@jas-valgotar jas-valgotar requested a review from a team as a code owner February 4, 2026 20:07
@jas-valgotar jas-valgotar changed the title wip Add caching for Table metadata fetch in CDP and update FieldType to Scaler for Salesforce Feb 4, 2026
@jas-valgotar
Copy link
Copy Markdown
Contributor Author

✅ No public API change.

@jas-valgotar jas-valgotar enabled auto-merge (squash) February 4, 2026 20:46
MikeStall
MikeStall previously approved these changes Feb 6, 2026
Copy link
Copy Markdown
Contributor

@MikeStall MikeStall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

MikeStall
MikeStall previously approved these changes Feb 6, 2026
Copy link
Copy Markdown
Contributor

@MikeStall MikeStall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jas-valgotar
Copy link
Copy Markdown
Contributor Author

✅ No public API change.

@jas-valgotar jas-valgotar force-pushed the jas/addCachingForCDPMetadata branch from d9fc3f5 to b6f6389 Compare February 6, 2026 21:32
@jas-valgotar
Copy link
Copy Markdown
Contributor Author

✅ No public API change.

@jas-valgotar jas-valgotar merged commit baf2913 into main Feb 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants