Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions registry/sql-registry/registry/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC, abstractmethod
from enum import Enum
from typing import Optional, Union, List, Dict
from typing import Any, Dict, List, Optional, Union
from uuid import UUID
import json
import re
Expand Down Expand Up @@ -417,15 +417,15 @@ def __init__(self,
qualified_name: str,
name: str,
type: str,
path: str,
preprocessing: Optional[str] = None,
event_timestamp_column: Optional[str] = None,
timestamp_format: Optional[str] = None,
tags: Dict = {}):
tags: dict = {},
**options: Dict[str, Any]):
self.qualified_name = qualified_name
self.name = name
self.type = type
self.path = path
self.options = options
self.preprocessing = preprocessing
self.event_timestamp_column = event_timestamp_column
self.timestamp_format = timestamp_format
Expand All @@ -435,14 +435,14 @@ def __init__(self,
def entity_type(self) -> EntityType:
return EntityType.Source

def to_dict(self) -> Dict:
ret = {
def to_dict(self) -> dict:
ret = self.options.copy()
ret = {**ret, **{
"qualifiedName": self.qualified_name,
"name": self.name,
"type": self.type,
"path": self.path,
"tags": self.tags,
}
}}
if self.preprocessing is not None:
ret["preprocessing"] = self.preprocessing
if self.event_timestamp_column is not None:
Expand Down Expand Up @@ -674,16 +674,16 @@ def to_attr(self) -> ProjectAttributes:
class SourceDef:
def __init__(self,
name: str,
path: str,
type: str,
qualified_name: str = "",
preprocessing: Optional[str] = None,
event_timestamp_column: Optional[str] = None,
timestamp_format: Optional[str] = None,
tags: Dict = {}):
tags: dict = {},
**options: Dict[str, Any]):
self.qualified_name = qualified_name
self.name = name
self.path = path
self.options = options
self.type = type
self.preprocessing = preprocessing
self.event_timestamp_column = event_timestamp_column
Expand All @@ -694,11 +694,11 @@ def to_attr(self) -> SourceAttributes:
return SourceAttributes(qualified_name=self.qualified_name,
name=self.name,
type=self.type,
path=self.path,
preprocessing=self.preprocessing,
event_timestamp_column=self.event_timestamp_column,
timestamp_format=self.timestamp_format,
tags=self.tags)
tags=self.tags,
**self.options)

class AnchorDef:
def __init__(self,
Expand Down