Repository: intake/intake

Issue:
Implementation of `discover` method for JSON driver
### Problem
I'm trying to apply the `discover` method on a [JSON catalog entry](https://github.com/eurec4a/eurec4a-intake/blob/6bbfab8a59af878d7e8aedde9a4ce859da9dcedd/tests/test_catalog.py#L38-L43). However, the `discover`-method is not yet implemented.

### What I did

```
from intake import Catalog
from intake.catalog.local import LocalCatalogEntry
cat = Catalog.from_dict({'x':LocalCatalogEntry('y','',args={'urlpath':"https://swift.dkrz.de/v1/dkrz_5ca791c6-a171-4f68-9266-e87c682e80ff/botany/botany_1536_params_records.json"}, driver="json")})
cat.x.discover()
```
resulting in
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../intake/intake/source/base.py", line 347, in discover
    self._load_metadata()
  File ".../intake/intake/source/base.py", line 285, in _load_metadata
    self._schema = self._get_schema()
  File ".../intake/intake/source/base.py", line 269, in _get_schema
    raise NotImplementedError
NotImplementedError
```

### Suggested implementation
How about adding

```python
def _load_metadata(self):
        pass

 def _get_schema(self):
        pass
```
to `class JSONLinesFileSource` and `JSONFileSource` similar to https://github.com/intake/intake/blob/6cae705c72d65ebf820675cbc1ccb689cb3ff2b8/intake/catalog/remote.py#L117-L121

Discussion:

Patch:
diff --git a/intake/source/jsonfiles.py b/intake/source/jsonfiles.py
index e7168c2..afa3272 100644
--- a/intake/source/jsonfiles.py
+++ b/intake/source/jsonfiles.py
@@ -80,6 +80,12 @@ class JSONFileSource(DataSource):
         ) as f:
             return json.load(f)
 
+    def _load_metadata(self):
+        pass
+
+    def _get_schema(self):
+        pass
+
 
 class JSONLinesFileSource(DataSource):
     """
@@ -167,3 +173,9 @@ class JSONLinesFileSource(DataSource):
         """
         with self._open() as f:
             return list(map(json.loads, islice(f, nrows)))
+
+    def _load_metadata(self):
+        pass
+
+    def _get_schema(self):
+        pass


Test patch:
diff --git a/intake/source/tests/test_json.py b/intake/source/tests/test_json.py
index 5ac7f18..ccdfd7b 100644
--- a/intake/source/tests/test_json.py
+++ b/intake/source/tests/test_json.py
@@ -64,6 +64,12 @@ def test_jsonfile_none(json_file: str):
     assert out["hello"] == "world"
 
 
+def test_jsonfile_discover(json_file: str):
+    j = JSONFileSource(json_file, text_mode=True, compression=None)
+    schema = j.discover()
+    assert schema == {'dtype': None, 'shape': None, 'npartitions': 0, 'metadata': {}}
+
+
 def test_jsonlfile(jsonl_file: str):
     j = JSONLinesFileSource(jsonl_file, compression="infer")
     out = j.read()
@@ -95,6 +101,12 @@ def test_jsonfilel_none(jsonl_file: str):
     assert out[1] == [1, 2, 3]
 
 
+def test_jsonfilel_discover(json_file: str):
+    j = JSONLinesFileSource(jsonl_file, compression=None)
+    schema = j.discover()
+    assert schema == {'dtype': None, 'shape': None, 'npartitions': 0, 'metadata': {}}
+
+
 def test_jsonl_head(jsonl_file: str):
     j = JSONLinesFileSource(jsonl_file, compression="infer")
     out = j.head(1)