Skip to content

Commit

Permalink
Remove deprecated extra = "forbid"
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Oct 15, 2024
1 parent 10ad08a commit 366f4ff
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 37 deletions.
6 changes: 0 additions & 6 deletions examples/llm/vdb_upload/module/content_extractor_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class CSVConverterSchema(BaseModel):
chunk_size: int = 1024
text_column_names: List[str]

class Config:
extra = "forbid"


class ContentExtractorSchema(BaseModel):
batch_size: int = 32
Expand All @@ -66,9 +63,6 @@ def val_converters_meta(cls, to_validate: Dict[str, Dict]) -> Dict[str, Dict]:
validated_meta[key] = value
return validated_meta

class Config:
extra = "forbid"


logger = logging.getLogger(__name__)

Expand Down
3 changes: 0 additions & 3 deletions examples/llm/vdb_upload/module/file_source_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ class FileSourcePipeSchema(BaseModel):
watch: bool = False # Flag to watch file changes
watch_interval: float = -5.0 # Interval to watch file changes

class Config:
extra = "forbid"


FileSourcePipeLoaderFactory = ModuleLoaderFactory("file_source_pipe", "morpheus_examples_llm", FileSourcePipeSchema)

Expand Down
3 changes: 0 additions & 3 deletions examples/llm/vdb_upload/module/rss_source_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ def validate_feed_input(cls, to_validate): # pylint: disable=no-self-argument

raise ValueError('feed_input must be a string or a list of strings')

class Config:
extra = "forbid"


RSSSourcePipeLoaderFactory = ModuleLoaderFactory("rss_source_pipe", "morpheus_examples_llm", RSSSourcePipeSchema)

Expand Down
6 changes: 0 additions & 6 deletions examples/llm/vdb_upload/module/schema_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,10 @@ class ColumnTransformSchema(BaseModel):
op_type: str
from_: Optional[str] = Field(None, alias="from")

class Config:
extra = "forbid"


class SchemaTransformSchema(BaseModel):
schema_transform_config: Dict[str, Dict[str, Any]] = Field(default_factory=dict)

class Config:
extra = "forbid"


SchemaTransformLoaderFactory = ModuleLoaderFactory("schema_transform", "morpheus_examples_llm", SchemaTransformSchema)

Expand Down
3 changes: 0 additions & 3 deletions examples/llm/vdb_upload/module/vdb_resource_tagging_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
class VDBResourceTaggingSchema(BaseModel):
vdb_resource_name: str

class Config:
extra = "forbid"


VDBResourceTaggingLoaderFactory = ModuleLoaderFactory("vdb_resource_tagging",
"morpheus_examples_llm",
Expand Down
3 changes: 0 additions & 3 deletions examples/llm/vdb_upload/module/web_scraper_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ class WebScraperSchema(BaseModel):
cache_path: str = "./.cache/http/RSSDownloadStage.sqlite"
cache_dir: str = "./.cache/llm/rss"

class Config:
extra = "forbid"


WebScraperLoaderFactory = ModuleLoaderFactory("web_scraper", "morpheus_examples_llm", WebScraperSchema)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
from typing import Dict
from typing import Optional

from pydantic import ConfigDict
from pydantic.dataclasses import dataclass
from pydantic import BaseModel

logger = logging.getLogger(__name__)


@dataclass(config=ConfigDict(extra="forbid"))
class DeserializeSchema:
class DeserializeSchema(BaseModel):
ensure_sliceable_index: bool = True
message_type: str = "ControlMessage"
task_type: Optional[str] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ class MultiFileSourceSchema(BaseModel):
watch_dir: bool = False
watch_interval: float = 1.0
batch_size: int = 128

class Config:
extra = "forbid"
3 changes: 0 additions & 3 deletions python/morpheus/morpheus/modules/schemas/rss_source_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,3 @@ class RSSSourceSchema(BaseModel):
interval_sec: int = 600
stop_after_rec: int = 0
strip_markup: bool = True

class Config:
extra = "forbid"
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,3 @@ def validate_resource_name(cls, to_validate): # pylint: disable=no-self-argumen
if not to_validate:
raise ValueError("Resource name must not be None or Empty.")
return to_validate

class Config:
extra = "forbid"

0 comments on commit 366f4ff

Please sign in to comment.