-
Notifications
You must be signed in to change notification settings - Fork 4
fix: Fix SQL dataframe integration #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Tomas Kislan <tomas@kislan.sk>
|
Warning Rate limit exceeded@tkislan has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 27 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR moves creation of the internal DuckDB (dataframe) SQL integration environment variable out of the per-integration loop and into the start of Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as getEnvironmentVariables
participant Env as EnvVarsCollector
participant Integrations as IntegrationsList
Note over Caller,Env: New flow (after PR)
Caller->>Env: create INTERNAL_DF env var (fixed JSON)
Caller->>Integrations: fetch integrations
loop for each integration
Integrations->>Caller: integration
alt integration is internal dataframe
Caller->>Integrations: continue (skip)
else other integration
Caller->>Env: add per-integration env vars
end
end
Caller->>Env: return collected env vars
sequenceDiagram
autonumber
participant Caller as getEnvironmentVariables
participant Env as EnvVarsCollector
participant Integrations as IntegrationsList
Note over Caller,Env: Old flow (before PR)
Caller->>Integrations: fetch integrations
loop for each integration
Integrations->>Caller: integration
alt integration is internal dataframe
Caller->>Env: add INTERNAL_DF env var (inside loop)
else other integration
Caller->>Env: add per-integration env vars
end
end
Caller->>Env: return collected env vars
Possibly related PRs
Suggested reviewers
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #139 +/- ##
======================================
Coverage 72% 72%
======================================
Files 541 541
Lines 41481 41596 +115
Branches 5027 5031 +4
======================================
+ Hits 30209 30323 +114
Misses 9593 9593
- Partials 1679 1680 +1
🚀 New features to boost your workflow:
|
Signed-off-by: Tomas Kislan <tomas@kislan.sk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts (2)
52-63: Update test name - no longer returns empty object.The test name claims "Returns empty object" but now expects the dataframe integration. Update to reflect the actual behavior.
Apply this diff:
- test('Returns empty object when notebook has no SQL cells', async () => { + test('Returns dataframe integration when notebook has no SQL cells', async () => {
65-75: Update test name - no longer returns empty object.Same issue: the test name claims "Returns empty object" but expects the dataframe integration.
Apply this diff:
- test('Returns empty object when SQL cells have no integration ID', async () => { + test('Returns dataframe integration when SQL cells have no integration ID', async () => {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.ts(2 hunks)src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts(9 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/!(*.node|*.web).ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place shared cross-platform logic in common
.tsfiles (not suffixed with.nodeor.web)
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.tssrc/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Usel10n.t()for user-facing strings
Use typed error classes fromsrc/platform/errors/when throwing or handling errors
Use theILoggerservice instead ofconsole.log
Preserve error details while scrubbing PII in messages and telemetry
Include the Microsoft copyright header in source files
Prefer async/await and handle cancellation withCancellationToken
**/*.{ts,tsx}: Order class members (methods, fields, properties) first by accessibility (public/protected/private) and then alphabetically
Do not add the Microsoft copyright header to new files
Use Uri.joinPath() to construct file paths instead of manual string concatenation
Add a blank line after groups of const declarations and before return statements for readability
Separate third-party imports from local file imports
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.tssrc/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.ts
**/*.unit.test.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place unit tests in files matching
*.unit.test.ts
**/*.unit.test.ts: Unit tests must use Mocha/Chai and have the .unit.test.ts extension
Place unit test files alongside the source files they test
Use assert.deepStrictEqual() for object comparisons in tests instead of checking individual properties
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
src/platform/**/*.ts
📄 CodeRabbit inference engine (.github/instructions/platform.instructions.md)
src/platform/**/*.ts: Use Inversify decorators for DI: annotate classes with @Injectable() and inject dependencies with @Inject(Token)
Use the centralized logger (import { logger } from '../platform/logging') instead of console.log for application logging
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.tssrc/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.ts
**/*.{test,spec}.ts
📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
In unit tests, when a mock is returned from a promise, ensure the mocked instance has an undefined
thenproperty to avoid hanging tests
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
🧬 Code graph analysis (1)
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.ts (2)
src/platform/notebooks/deepnote/integrationTypes.ts (1)
DATAFRAME_SQL_INTEGRATION_ID(5-5)src/platform/logging/index.ts (1)
logger(35-48)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build & Test
🔇 Additional comments (3)
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.ts (2)
202-213: LGTM - Dataframe integration now always present.The refactoring ensures the internal DuckDB integration is set up regardless of other integrations, resolving the stated issue.
234-237: Correct handling of internal integration.Skipping the dataframe integration during the loop is appropriate since it's already been added.
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts (1)
17-19: Good use of constant for expected values.The constant correctly matches the hardcoded dataframe integration from the provider.
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
Show resolved
Hide resolved
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
Show resolved
Hide resolved
Signed-off-by: Tomas Kislan <tomas@kislan.sk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts (2)
52-63: Update test name to reflect actual behavior.The test name says "Returns empty object" but now returns the internal DuckDB integration. Consider renaming to reflect that the dataframe integration is always present.
- test('Returns empty object when notebook has no SQL cells', async () => { + test('Returns only dataframe integration when notebook has no SQL cells', async () => {
65-75: Update test name to reflect actual behavior.The test name says "Returns empty object" but now returns the internal DuckDB integration.
- test('Returns empty object when SQL cells have no integration ID', async () => { + test('Returns only dataframe integration when SQL cells have no integration ID', async () => {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts(9 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/!(*.node|*.web).ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place shared cross-platform logic in common
.tsfiles (not suffixed with.nodeor.web)
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Usel10n.t()for user-facing strings
Use typed error classes fromsrc/platform/errors/when throwing or handling errors
Use theILoggerservice instead ofconsole.log
Preserve error details while scrubbing PII in messages and telemetry
Include the Microsoft copyright header in source files
Prefer async/await and handle cancellation withCancellationToken
**/*.{ts,tsx}: Order class members (methods, fields, properties) first by accessibility (public/protected/private) and then alphabetically
Do not add the Microsoft copyright header to new files
Use Uri.joinPath() to construct file paths instead of manual string concatenation
Add a blank line after groups of const declarations and before return statements for readability
Separate third-party imports from local file imports
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
**/*.unit.test.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place unit tests in files matching
*.unit.test.ts
**/*.unit.test.ts: Unit tests must use Mocha/Chai and have the .unit.test.ts extension
Place unit test files alongside the source files they test
Use assert.deepStrictEqual() for object comparisons in tests instead of checking individual properties
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
src/platform/**/*.ts
📄 CodeRabbit inference engine (.github/instructions/platform.instructions.md)
src/platform/**/*.ts: Use Inversify decorators for DI: annotate classes with @Injectable() and inject dependencies with @Inject(Token)
Use the centralized logger (import { logger } from '../platform/logging') instead of console.log for application logging
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
**/*.{test,spec}.ts
📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
In unit tests, when a mock is returned from a promise, ensure the mocked instance has an undefined
thenproperty to avoid hanging tests
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
🔇 Additional comments (6)
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts (6)
17-19: LGTM!Constant clearly defines the baseline environment variables that always include the internal DuckDB integration.
193-195: LGTM!Comment correctly clarifies that the count includes the dataframe integration plus the PostgreSQL integration. Past review concern has been addressed.
237-240: LGTM!Comment correctly clarifies that the count includes the dataframe integration plus two other integrations. Past review concern has been addressed.
654-654: LGTM!Assertion correctly updated to expect the dataframe integration for unsupported auth methods.
678-678: LGTM!Assertion correctly updated to expect the dataframe integration for unsupported auth methods.
628-630: Update comment to reflect actual behavior.The comment says "Should return empty object" but the assertion expects the dataframe integration to be present.
- // Should return empty object when unsupported auth method is encountered + // Should return only dataframe integration when unsupported auth method is encountered const envVars = await provider.getEnvironmentVariables(uri); assert.deepStrictEqual(envVars, EXPECTED_EMPTY_ENV_VARS);Likely an incorrect or invalid review comment.
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Tomas Kislan <tomas@kislan.sk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts(9 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/!(*.node|*.web).ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place shared cross-platform logic in common
.tsfiles (not suffixed with.nodeor.web)
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Usel10n.t()for user-facing strings
Use typed error classes fromsrc/platform/errors/when throwing or handling errors
Use theILoggerservice instead ofconsole.log
Preserve error details while scrubbing PII in messages and telemetry
Include the Microsoft copyright header in source files
Prefer async/await and handle cancellation withCancellationToken
**/*.{ts,tsx}: Order class members (methods, fields, properties) first by accessibility (public/protected/private) and then alphabetically
Do not add the Microsoft copyright header to new files
Use Uri.joinPath() to construct file paths instead of manual string concatenation
Add a blank line after groups of const declarations and before return statements for readability
Separate third-party imports from local file imports
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
**/*.unit.test.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Place unit tests in files matching
*.unit.test.ts
**/*.unit.test.ts: Unit tests must use Mocha/Chai and have the .unit.test.ts extension
Place unit test files alongside the source files they test
Use assert.deepStrictEqual() for object comparisons in tests instead of checking individual properties
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
src/platform/**/*.ts
📄 CodeRabbit inference engine (.github/instructions/platform.instructions.md)
src/platform/**/*.ts: Use Inversify decorators for DI: annotate classes with @Injectable() and inject dependencies with @Inject(Token)
Use the centralized logger (import { logger } from '../platform/logging') instead of console.log for application logging
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
**/*.{test,spec}.ts
📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
In unit tests, when a mock is returned from a promise, ensure the mocked instance has an undefined
thenproperty to avoid hanging tests
Files:
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
🔇 Additional comments (5)
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts (5)
193-195: Comment update looks good.The updated comment correctly reflects that there are 2 total env vars (dataframe + postgres). Past review issue has been addressed.
237-240: Comment update looks good.The updated comment correctly reflects that there are 3 total env vars (dataframe + postgres + bigquery). Past review issue has been addressed.
258-259: Comment update looks good.The updated comment accurately describes the behavior. Past review issue has been addressed.
62-62: Assertions correctly updated.All test assertions now properly expect the dataframe integration to be present in baseline scenarios. Changes are consistent with the PR objectives.
Also applies to: 74-74, 628-630, 654-654, 678-678
39-50: Early-exit tests are correct as written.The production code confirms early exits occur before dataframe integration is added. All three early-exit scenarios (undefined resource, notebook not found, cancellation) return
{}at lines 182-199, and dataframe integration is added only after at lines 202-212. Tests correctly expect{}for these conditions.
src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Tomas Kislan <tomas@kislan.sk>
* fix: Fix SQL dataframe integration Signed-off-by: Tomas Kislan <tomas@kislan.sk> * test: Update test expectations Signed-off-by: Tomas Kislan <tomas@kislan.sk> * test: Update comments Signed-off-by: Tomas Kislan <tomas@kislan.sk> * test: Update comments Signed-off-by: Tomas Kislan <tomas@kislan.sk> * test: Rename empty env vars test variable Signed-off-by: Tomas Kislan <tomas@kislan.sk> --------- Signed-off-by: Tomas Kislan <tomas@kislan.sk>
duckdb integration was not set up when there were no other integrations in deepnote file
Summary by CodeRabbit
Refactor
Tests