djanand commented on code in PR #1883:
URL:
https://github.com/apache/datafusion-ballista/pull/1883#discussion_r3584889042
##########
python/python/ballista/jupyter.py:
##########
@@ -221,6 +232,45 @@ def register(self, line: str) -> Optional[str]:
"Currently not supporting the inserted file format"
)
+ @staticmethod
+ def _parse_cell_magic_args(line: str):
+ """Parse the argument line of a ``%%sql`` cell magic.
+
+ Recognises the ``--no-display`` and ``--limit N`` flags (space form,
+ e.g. ``--limit 5``, consistent with the other magics in this module).
+ The first non-flag token, if any, is treated as the variable name to
+ store the result in.
+
+ Returns a ``(var_name, no_display, limit)`` tuple where ``limit`` is
+ ``None`` when ``--limit`` was not supplied. Raises ``ValueError`` for a
+ missing or invalid ``--limit`` value.
+ """
+ tokens = line.strip().split()
+ var_name = None
+ no_display = False
+ limit = None
+
+ i = 0
+ while i < len(tokens):
Review Comment:
sure makes sense. addressed
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]