udim commented on a change in pull request #14431:
URL: https://github.com/apache/beam/pull/14431#discussion_r618840227
##########
File path: examples/notebooks/tour-of-beam/reading-and-writing-data.ipynb
##########
@@ -606,32 +657,31 @@
" def teardown(self):\n",
" self.connection.close()\n",
"\n",
- "class SelectFromSQLite(beam.PTransform):\n",
- " def __init__(self, database_file, queries):\n",
- " self.database_file = database_file\n",
- " self.queries = queries\n",
- "\n",
- " def expand(self, pcollection):\n",
- " return (\n",
- " pcollection\n",
- " | 'Create None' >> beam.Create(queries)\n",
- " | 'SQLite SELECT' >>
beam.ParDo(SQLiteSelect(self.database_file))\n",
- " )\n",
+ "@beam.ptransform_fn\n",
+ "@beam.typehints.with_input_types(beam.pvalue.PBegin)\n",
+ "@beam.typehints.with_output_types(Dict[str, str])\n",
+ "def SelectFromSQLite(pcollection, database_file: str, queries:
List[Tuple[str, List[str]]]):\n",
Review comment:
same here and below
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]