Skip to content

Commit

Permalink
[NADE] Add feature check to allow codegen (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-bgoel authored May 9, 2024
1 parent b4eb863 commit 63884b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,13 @@ def process(
src_py_file_to_collected_entities[dest_file] = collected_entities

if collected_entities is None:
cc.message("No entities could be collected from the file path.")
continue

cc.message(f"This is the file path in deploy root: {dest_file}\n")
cc.message("This is the list of collected entities:")
cc.message(collected_entities)

# 4. Enrich entities by setting additional properties
for entity in collected_entities:
_enrich_entity(
Expand Down
13 changes: 12 additions & 1 deletion src/snowflake/cli/plugins/nativeapp/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
source_path_to_deploy_path,
translate_artifact,
)
from snowflake.cli.plugins.nativeapp.codegen.compiler import (
_find_and_execute_processors,
)
from snowflake.cli.plugins.nativeapp.constants import (
ALLOWED_SPECIAL_COMMENTS,
COMMENT_COL,
Expand All @@ -47,6 +50,7 @@
MissingPackageScriptError,
UnexpectedOwnerError,
)
from snowflake.cli.plugins.nativeapp.feature_flags import FeatureFlag
from snowflake.cli.plugins.nativeapp.utils import verify_exists, verify_no_directories
from snowflake.cli.plugins.stage.diff import (
DiffResult,
Expand Down Expand Up @@ -309,7 +313,14 @@ def build_bundle(self) -> ArtifactDeploymentMap:
"""
Populates the local deploy root from artifact sources.
"""
return build_bundle(self.project_root, self.deploy_root, self.artifacts)
mapped_files = build_bundle(self.project_root, self.deploy_root, self.artifacts)
if FeatureFlag.ENABLE_SETUP_SCRIPT_GENERATION.is_enabled():
_find_and_execute_processors(
project_definition=self._project_definition,
project_root=self.project_root,
deploy_root=self.deploy_root,
)
return mapped_files

def sync_deploy_root_with_stage(
self,
Expand Down

0 comments on commit 63884b4

Please sign in to comment.