Skip to content

Conversation

@lpi-tn
Copy link
Collaborator

@lpi-tn lpi-tn commented Oct 14, 2025

This pull request refactors the codebase to use the new welearn_database package for all database models and enumerations, replacing the previous welearn_datastack.data.db_models and related imports. It also updates test fixtures and document content strings for improved clarity and consistency. These changes ensure better modularity, maintainability, and compatibility with the updated database package.

Migration to welearn_database package:

  • Replaced all imports of welearn_datastack.data.db_models and related enumeration modules with corresponding imports from welearn_database.data.models and welearn_database.data.enumeration across all test and utility files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]

  • Added welearn-database = "^0.2.5" as a dependency in pyproject.toml to support the new database package.

Test data and fixtures updates:

  • Updated test document content strings to use more realistic and varied sample text instead of generic placeholders, improving test clarity and robustness. [1] [2] [3] [4] [5] [6] [7] [8] [9]

  • Removed unused or unnecessary imports, such as Mock, where not needed, and cleaned up test setup code for better readability. [1] [2]

General code consistency:

  • Reordered imports and ensured consistent import patterns for database utilities and models in all test modules, improving maintainability. [1] [2] [3] [4] [5]

These changes collectively modernize the codebase, streamline database interactions, and enhance test reliability.

@lpi-tn lpi-tn requested a review from Copilot October 16, 2025 16:00
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 pull request migrates the codebase from using the welearn_datastack.data.db_models package to the new welearn_database package for all database models and enumerations. This modernization effort improves modularity and maintainability while ensuring compatibility with the updated database infrastructure.

  • Replaces all database model imports with corresponding imports from welearn_database.data.models
  • Updates enumeration imports to use welearn_database.data.enumeration
  • Removes the deprecated welearn_datastack/data/db_models.py file entirely
  • Adds welearn-database = "^0.2.5" dependency to support the new database package

Reviewed Changes

Copilot reviewed 75 out of 76 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Adds the new welearn-database dependency
welearn_datastack/data/db_models.py Completely removes the deprecated database models file
welearn_datastack/data/enumerations.py Comments out the Step enum as it's now imported from the new package
Multiple workflow files Updates imports to use welearn_database package for models and enumerations
Multiple collector files Migrates database model imports to the new package
Multiple test files Updates test imports and improves test fixture content
alembic/env.py Updates the database models import for migration support
Comments suppressed due to low confidence (1)

welearn_datastack/nodes_workflow/DocumentHubCollector/document_collector.py:1

  • This line is removing the assignment of trace from scraped document to database document, which could result in loss of trace information. Verify this is intentional or if the trace field has been moved elsewhere in the new database schema.
import csv

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lpi-tn lpi-tn merged commit 28eeb0b into main Oct 17, 2025
7 checks passed
@lpi-tn lpi-tn deleted the Fix/switch-to-welearn-database-package branch October 17, 2025 10:13
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