dataform-dependency-visualizer 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dataform-dependency-visualizer
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Visualize Dataform table dependencies as interactive SVG diagrams
5
5
  Home-page: https://github.com/OshigeAkito/dataform-dependency-visualizer
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "dataform-dependency-visualizer"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "Visualize Dataform table dependencies as interactive SVG diagrams"
5
5
  readme = "README_PACKAGE.md"
6
6
  authors = ["Thamo <thamo@example.com>"]
@@ -64,7 +64,14 @@ def cleanup_sqlx_files(definitions_dir="definitions", backup=True):
64
64
  config_content = match.group(2)
65
65
  suffix = match.group(3)
66
66
 
67
- # Remove *_utils.PROJECT_ID patterns from config content
67
+ # Check if database property contains *_utils.PROJECT_ID
68
+ has_project_id = re.search(r'database:\s*.*?\w+_utils\.PROJECT_ID', config_content)
69
+
70
+ if has_project_id:
71
+ # Remove entire database property line
72
+ config_content = re.sub(r'\s*database:\s*[^,\n]*(?:,|\n|$)', '', config_content)
73
+
74
+ # Also remove any remaining *_utils.PROJECT_ID patterns in other properties
68
75
  # Pattern 1: ${<word>_utils.PROJECT_ID} with optional trailing dot
69
76
  config_content = re.sub(r'\$\{\w+_utils\.PROJECT_ID\}\.?', '', config_content)
70
77
  # Pattern 2: <word>_utils.PROJECT_ID with optional trailing dot
@@ -72,6 +79,14 @@ def cleanup_sqlx_files(definitions_dir="definitions", backup=True):
72
79
  # Pattern 3: Backticks with ${<word>_utils.PROJECT_ID}
73
80
  config_content = re.sub(r'`?\$\{\w+_utils\.PROJECT_ID\}`?\.?', '', config_content)
74
81
 
82
+ # Clean up resulting syntax issues
83
+ # Remove double commas
84
+ config_content = re.sub(r',\s*,', ',', config_content)
85
+ # Remove trailing comma before closing brace
86
+ config_content = re.sub(r',(\s*)\}', r'\1}', config_content)
87
+ # Remove comma after opening brace
88
+ config_content = re.sub(r'\{\s*,', '{', config_content)
89
+
75
90
  return prefix + config_content + suffix
76
91
 
77
92
  # Replace only in config blocks