Skip to content

Commit d82837f

Browse files
authored
Merge pull request #758 from airweave-ai/feat/include-path-gdrive
fix(google_drive): include_pattern + exclude volatile fields from hash
2 parents 5e23a3d + 478130a commit d82837f

File tree

3 files changed

+598
-175
lines changed

3 files changed

+598
-175
lines changed

backend/airweave/platform/configs/config.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,27 +99,21 @@ class GoogleCalendarConfig(SourceConfig):
9999
class GoogleDriveConfig(SourceConfig):
100100
"""Google Drive configuration schema."""
101101

102-
# exclude_patterns: list[str] = Field(
103-
# default=[],
104-
# title="Exclude Patterns",
105-
# description=(
106-
# "List of file/folder paths or patterns to exclude from synchronization. "
107-
# "Examples: '*.tmp', 'Private/*', 'Confidential Reports/'. "
108-
# "Separate multiple patterns with commas."
109-
# ),
110-
# )
111-
112-
# @validator("exclude_patterns", pre=True)
113-
# def parse_exclude_patterns(cls, value):
114-
# """Convert string input to list if needed."""
115-
# if isinstance(value, str):
116-
# if not value.strip():
117-
# return []
118-
# # Split by commas and strip whitespace
119-
# return [pattern.strip() for pattern in value.split(",") if pattern.strip()]
120-
# return value
102+
include_patterns: list[str] = Field(
103+
default=[],
104+
title="Include Patterns",
105+
description=(
106+
"List of file/folder paths to include in synchronization. "
107+
"Examples: 'my_folder/*', 'my_folder/my_file.pdf'. "
108+
"Separate multiple patterns with commas. If empty, all files are included."
109+
),
110+
)
121111

122-
pass
112+
@validator("include_patterns", pre=True)
113+
def _parse_include_patterns(cls, value):
114+
if isinstance(value, str):
115+
return [p.strip() for p in value.split(",") if p.strip()]
116+
return value
123117

124118

125119
class HubspotConfig(SourceConfig):

0 commit comments

Comments
 (0)