Skip to content

Commit

Permalink
Revert changes to environment_name
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhang committed Jan 3, 2024
1 parent 5a83a87 commit f43d0ba
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions 04_secrets/db_to_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_db_rows():

@stub.function(
image=requests_image,
secret=modal.Secret.from_name("weather-secret", environment_name="main"),
secret=modal.Secret.from_name("weather-secret"),
)
def city_weather(city):
import requests
Expand Down Expand Up @@ -169,7 +169,7 @@ def main():

@stub.function(
image=pygsheets_image,
secret=modal.Secret.from_name("gsheets-secret", environment_name="main"),
secret=modal.Secret.from_name("gsheets-secret"),
)
def update_sheet_report(rows):
import pygsheets
Expand Down
2 changes: 1 addition & 1 deletion 06_gpu_and_ml/mini_dalle_slackbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def load_model(device=None):

@stub.function(
image=Image.debian_slim().pip_install("slack-sdk"),
secret=Secret.from_name("dalle-bot-slack-secret", environment_name="main"),
secret=Secret.from_name("dalle-bot-slack-secret"),
)
def post_to_slack(prompt: str, channel_name: str, image_bytes: bytes):
import slack_sdk
Expand Down
2 changes: 1 addition & 1 deletion 10_integrations/algolia_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

@stub.function(
image=algolia_image,
secrets=[Secret.from_name("algolia-secret", environment_name="main")],
secrets=[Secret.from_name("algolia-secret")],
)
def crawl():
# Installed with a 3.6 venv; Python 3.6 is unsupported by Modal, so use a subprocess instead.
Expand Down
4 changes: 1 addition & 3 deletions 10_integrations/dbt/dbt_duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@
#
# Below we will use this user in a Modal function to create an S3 bucket and
# populate it with .parquet data.
s3_secret = modal.Secret.from_name(
"modal-examples-aws-user", environment_name="main"
)
s3_secret = modal.Secret.from_name("modal-examples-aws-user")

# ## Seed data
#
Expand Down
2 changes: 1 addition & 1 deletion misc/news_summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class NYArticle:


@stub.function(
secret=modal.Secret.from_name("nytimes", environment_name="main"),
secret=modal.Secret.from_name("nytimes"),
image=scraping_image,
)
def latest_science_stories(n_stories: int = 5) -> List[NYArticle]:
Expand Down
4 changes: 1 addition & 3 deletions misc/webscraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ async def get_links(url: str) -> set[str]:

@stub.function(
image=slack_sdk_image,
secret=modal.Secret.from_name(
"scraper-slack-secret", environment_name="main"
),
secret=modal.Secret.from_name("scraper-slack-secret"),
)
def bot_token_msg(channel, message):
import slack_sdk
Expand Down

0 comments on commit f43d0ba

Please sign in to comment.