@@ -60,7 +60,8 @@ def temporary_stage(self) -> str:
60
60
@property
61
61
def temporary_file_format (self ) -> FileFormat :
62
62
return FileFormat (
63
- schema = self .schema_name ,
63
+ database = self .database ,
64
+ schema_name = self .schema_name ,
64
65
name = f"tmp_file_format_{ self .schema_name } _{ self .name } " .upper (),
65
66
)
66
67
@@ -69,7 +70,7 @@ def get_create_temporary_file_format_statement(self, file_format: str) -> str:
69
70
Creates a temporary file format with the inline arguments
70
71
"""
71
72
file_format_statement = f"""
72
- CREATE OR REPLACE TEMPORARY FILE FORMAT { self .schema_name } . { self . temporary_file_format }
73
+ CREATE OR REPLACE TEMPORARY FILE FORMAT { self .temporary_file_format }
73
74
{ file_format }
74
75
"""
75
76
return file_format_statement
@@ -83,8 +84,14 @@ def get_create_temporary_external_stage(
83
84
self , path : str , storage_integration : str
84
85
) -> str :
85
86
logging .debug (f"Creating temporate stage at path: { path } " )
87
+ # Create a temporary stage with proper FQN
88
+ stage_fqn = (
89
+ f"{ self .database } .{ self .schema_name } .{ self .temporary_stage } "
90
+ if self .database
91
+ else f"{ self .schema_name } .{ self .temporary_stage } "
92
+ )
86
93
return f"""
87
- CREATE OR REPLACE TEMPORARY STAGE { self . schema_name } . { self . temporary_stage }
94
+ CREATE OR REPLACE TEMPORARY STAGE { stage_fqn }
88
95
URL='{ path } '
89
96
STORAGE_INTEGRATION = { storage_integration }
90
97
"""
0 commit comments