假设我有一个 AWS 步骤函数,它只是将第一步的输出传递到第二步。但现在假设我需要为第二步添加额外的输入值。
如何设置第二步的参数以保留所有输入字段(无需单独指定它们)并添加新的输入值?
我能得到的最接近的参数是这样设置的:
"Second Step": {
"Type": "Task",
"Resource": "arn:aws:lambda:blahblahblah",
"InputPath": "$",
"Parameters": {
"Input.$":"$",
"additionalValue": "ABC"
}
}
Run Code Online (Sandbox Code Playgroud)
但这会导致将所有输入值推送到新的“Input”键下,我实际上只想将它们放在字典的根目录中。我可以发誓,我曾经看到过一些神奇的表情,使这个作品按照我想要的方式工作,但现在我找不到它了。
AWS 现在有一个模拟器,您可以在. 将 InputPath 设置为$并将参数设置为{"Input.$":"$","additionalValue":"ABC"}以查看这种情况的示例。
我无法理解如何执行查询以检查并查看sqlalchemy中是否已存在匹配的记录.我在网上找到的大多数例子似乎都引用了我没有的"会话"和"查询"对象.
这是一个简短的完整程序,用于说明我的问题:
1.使用"person"表设置内存中的sqlite数据库.
2.将两个记录插入到人员表中.
3.检查表中是否存在特定记录.这是barfs的地方.
from sqlalchemy import create_engine, Table, Column, Integer, String, MetaData
from sqlalchemy.sql.expression import exists
engine = create_engine('sqlite:///:memory:', echo=False)
metadata = MetaData()
person = Table('person', metadata,
Column('id', Integer, primary_key=True),
Column('name', String(255), nullable=False))
metadata.create_all(engine)
conn = engine.connect()
s = person.insert()
conn.execute(s, name="Alice")
conn.execute(s, name="Bob")
print("I can see the names in the table:")
s = person.select()
result = conn.execute(s)
print(result.fetchall())
print('This query looks like it should check to see if a matching record exists:')
s = person.select().where(person.c.name == "Bob") …Run Code Online (Sandbox Code Playgroud)