我开始将你们的一些转换工作迁移到 DBT。如下图所示,在获得最终表格之前通常需要进行 1 到 2 次转换(在某些情况下最多进行 5 次转换)。
我想要实现的是仅针对链接模型上的集合执行 dbt 运行。例如,sales_prediction
和forecast
。我目前可以dbt run o
使用 r just 特定模型来运行所有内容dbt run --select model_name
我花了最近几天的时间试图找出我做错了什么,但我仍然无法弄清楚,因为我能够flask run
使用docker-compose up --build
. 源代码在这里
我的问题是我的 Cloud Run 部署成功,但单击URL时服务不可用。我检查了日志,似乎我的环境变量没有正确加载:
line 7, in <module> from web_messaging.blueprints.user import user File
"/web_messaging/web_messaging/blueprints/user/__init__.py", line 1, in <module> from
web_messaging.blueprints.user.views import user File
"/web_messaging/web_messaging/blueprints/user/views.py", line 3, in <module> from
web_messaging.extensions import mongo, login_manager, c, bc File
"/web_messaging/web_messaging/extensions.py", line 18, in <module> twilio_client = Client(TWILIO_SID,
TWILIO_TOKEN) File "/usr/local/lib/python3.9/site-packages/twilio/rest/__init__.py", line 54, in __init__
raise TwilioException("Credentials are required to create a TwilioClient")
twilio.base.exceptions.TwilioException: Credentials are required to create a TwilioClient
Run Code Online (Sandbox Code Playgroud)
我有一个config/.env …
我正在尝试创建一个工具来轻松创建和销毁我的 AWS 组织中的 AWS 账户(或者至少将其从组织中删除,如果无法删除)。这些帐户将成为沙盒,预算很少,并在几周后被销毁。
我发现 Terraform 有一个名为aws_organizations_account的特定资源。
但是,提到删除此 Terraform 资源只会从组织中删除 AWS 帐户。Terraform 不会关闭该帐户。会员帐户必须事先准备为独立帐户。有关更多信息,请参阅 AWS Organizations 文档。
我aws_organizations_account
使用 terraform 部署了资源,它有效。但是当我尝试删除该资源时,我出现了一个警告问题The member account must be configured with a valid payment method, such as a credit card
主.tf
resource "aws_organizations_account" "account" {
name = "sandbox1"
email = "first.last+sandbox1@company.com"
role_name = "myOrganizationRole"
}
Run Code Online (Sandbox Code Playgroud)
有什么办法可以解决这个问题吗?
我正在构建一个浏览器游戏,其中每个用户都有 4 种类型的资源,并且每个用户根据其农场的级别生产更多资源。
我想做的是,每当给定用户登录时,我想在他刷新页面或执行任何操作时重新计算其当前资源。
似乎中间件是满足我的需要的正确工具,但我对当前架构(多个路由器)的实现有点困惑。在执行任何其他 API 调用之前调用函数来执行资源重新计算的最简洁方法是什么?
这是我到目前为止所尝试过的(示例中间件):
app.py(无中间件):
from fastapi import FastAPI, Depends, Request
from src.api.v1.village import village_router
from src.api.v1.auth import auth_router
from src.api.v1.admin import admin_router
from src.core.auth import get_current_user
from src.core.config import *
def create_app() -> FastAPI:
root_app = FastAPI()
root_app.include_router(
auth_router,
prefix="/api/v1",
tags=["auth"],
)
root_app.include_router(
admin_router,
prefix="/api/v1",
tags=["admin"],
dependencies=[Depends(get_current_user)],
)
root_app.include_router(
village_router,
prefix="/api/v1",
tags=["village"],
)
return root_app
Run Code Online (Sandbox Code Playgroud)
然后,我添加了一个helloworld
中间件并将 get_current_user 添加为依赖项,因为用户必须登录才能执行计算。
app.py(带有中间件):
from fastapi import FastAPI, Depends, Request
from src.api.v1.village import village_router
from src.api.v1.auth import auth_router …
Run Code Online (Sandbox Code Playgroud) 我有一个 Terraform 脚本,允许我使用aws_organization_account资源在组织内部创建新的 AWS 账户。我在创建新帐户时没有任何问题,但我想知道以 root 用户身份登录新帐户的初始密码是什么?有办法设置吗?如果我想使用电子邮件以根用户身份登录,目前需要单击“我忘记了密码”。
主.tf
resource "aws_organizations_account" "this" {
name = "user1"
email = "user1+prod@gmail.com"
parent_id = module.organizations.sandbox_organizational_unit_id
}
Run Code Online (Sandbox Code Playgroud)
之后,我将进入 AWS 日志记录页面,以 root 用户身份登录并user1+prod@gmail.com
单击"I forgot my password"
,因为我不知道初始密码
我有一个文件夹queries
,用户可以在其中添加、删除和修改yaml
文件。每个 yaml 文件代表 GCP 上的单个 terraform 资源,即调度查询。
循环查询文件夹并main.tf
相应地在 main 中生成适当数量的 terraform 资源的最干净方法是什么?我可以使用Python来生成main.tf
如果它更容易
1 个信号资源的示例:
查询/alpha.yaml
display_name: "my-query"
data_source_id: "scheduled_query"
schedule: "first sunday of quarter 00:00"
destination_dataset_id: "results"
destination_table_name_template: "my_table"
write_disposition: "WRITE_APPEND"
query: "SELECT name FROM tabl WHERE x = 'y'"
Run Code Online (Sandbox Code Playgroud)
这应该在我的main.tf中创建这个资源
resource "google_bigquery_data_transfer_config" "query_config" {
display_name = "my-query"
data_source_id = "scheduled_query"
schedule = "first sunday of quarter 00:00"
destination_dataset_id = "results"
params = {
destination_table_name_template = "my_table"
write_disposition = …
Run Code Online (Sandbox Code Playgroud) 我目前正在使用 FastAPI 构建后端,并且在使用诗歌脚本运行后端时遇到一些问题。这是我的项目结构:
\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 backend\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 src\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 asgi.py\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 Dockerfile\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 poetry.lock\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 pyproject.toml\n
Run Code Online (Sandbox Code Playgroud)\npyproject.toml
\n[tool.poetry]\nname = "backend"\nversion = "0.1.0"\ndescription = ""\nauthors = ["Pierre-Alexandre35 <46579114+pamousset75@users.noreply.github.com>"]\nreadme = "README.md"\n\n[tool.poetry.dependencies]\npython = "^3.9"\nuvicorn = "^0.17.6"\nfastapi = "^0.78.0"\npsycopg2 = "^2.9.3"\njwt = "^1.3.1"\npython-multipart = "^0.0.5"\n\n\n[build-system]\nrequires = ["poetry-core"]\nbuild-backend = "poetry.core.masonry.api"\n\n[tool.poetry.scripts]\nfoo='asgi:__main__'\n
Run Code Online (Sandbox Code Playgroud)\n如果我正在运行 poetry run python asgi.py
,它工作得很好,但如果我使用poetry foo
脚本,我会得到No file/folder found for package backend
。这些都是我尝试过的组合,每个组合都有相同的错误poetry run foo
:
foo='asgi:main'\nfoo='backend.asgi:__main__'\nfoo='backend.asgi:main'\nfoo='backend.asgi:.'\n
Run Code Online (Sandbox Code Playgroud)\n 我计划有一个云调度程序,每天早上 8 点调用 GCP 工作流程。我的 GCP 工作流程将有大约 15 个不同的工作流程steps
,并且仅在 BigQuery 上进行转换(更新、删除、添加)。有些查询会很长,我想知道是否有办法将.sql
文件加载到 GCP 工作流程中task1.yaml
?
#workflow entrypoint
ProcessItem:
params: [project, gcsPath]
steps:
- initialize:
assign:
- dataset: wf_samples
- input: ${gcsPath}
- sqlQuery: QUERY HERE
...
Run Code Online (Sandbox Code Playgroud)