Skip to content

Conversation

@Chenglong-MS
Copy link
Collaborator

update with mysql port support

Chenglong-MS and others added 5 commits July 1, 2025 17:53
Introduces a new optional parameter for specifying the MySQL server port, defaulting to 3306.

Updates connection instructions to include port information for both local and remote connections.

Enhances clarity in troubleshooting steps for testing connections with the specified port.
Adds support for MySQL port configuration
@Chenglong-MS Chenglong-MS requested a review from Copilot July 2, 2025 18:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds slot-based model assignment functionality to the state and UI, and introduces MySQL port support in the Python data loader.

  • Define ModelSlots and related actions/selectors in dfSlice for 'generation' and 'hint' slots.
  • Update ModelSelectionDialog.tsx to allow assigning models to slots with a new summary component and refined table UI.
  • Add port parameter to MySQL loader, update connection instructions, and bump the project version.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/app/dfSlice.tsx Added ModelSlotType/ModelSlots, updated reducers, actions, and selectors for slots.
src/views/ModelSelectionDialog.tsx Revamped dialog UI to support slot assignments, including SlotAssignmentSummary.
pyproject.toml Bumped package version from 0.2.1.4 to 0.2.1.5.
py-src/data_formulator/data_loader/mysql_data_loader.py Introduced optional port parameter and updated auth instructions accordingly.
Comments suppressed due to low confidence (2)

src/app/dfSlice.tsx:791

  • [nitpick] The selector 'getActiveModel' specifically returns the 'generation' slot model; consider renaming it to 'getGenerationModel' for clarity.
    getActiveModel: (state: DataFormulatorState) : ModelConfig => {

src/app/dfSlice.tsx:50

  • Consider adding unit tests for the new ModelSlots reducer logic and getModelBySlot selector to verify correct slot assignments.
export interface ModelSlots {

self.duck_db_conn.install_extension("mysql")
self.duck_db_conn.load_extension("mysql")

attatch_string = ""
Copy link

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

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

Variable name 'attatch_string' is misspelled; consider renaming to 'attach_string' for clarity.

Copilot uses AI. Check for mistakes.
const noBorderStyle = ['error'].includes(status) ? 'none' : undefined;

// Check if model is assigned to any slot
const isAssignedToAnySlot = dfSelectors.getAllSlotTypes().some(slotType => isModelAssignedToSlot(model.id, slotType));
Copy link

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

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

[nitpick] Refactoring opportunity: call dfSelectors.getAllSlotTypes() once into a local variable to avoid repeated selector calls and improve readability.

Suggested change
const isAssignedToAnySlot = dfSelectors.getAllSlotTypes().some(slotType => isModelAssignedToSlot(model.id, slotType));
const isAssignedToAnySlot = allSlotTypes.some(slotType => isModelAssignedToSlot(model.id, slotType));

Copilot uses AI. Check for mistakes.
Chenglong-MS and others added 2 commits July 2, 2025 11:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Chenglong-MS Chenglong-MS merged commit 42be5f4 into main Jul 2, 2025
7 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.

3 participants